Results 1 to 9 of 9
  1. #1
    Steven.Allman is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    118

    Current Date button on Report

    I have a report in my database that shows past due information. Each record has an Email and Update button.
    The email button works great, but I cannot get the Update button to work. I only want it to add a date to a field.
    I know that SPACES in my table names are an issue, but I have been able to code around that all this time. I cant get past it here though.. Anyone got ideas? Here is what I have tried


    Private Sub Command10_Click()
    Positive_Packets.RX_2nd_Request_Date = Date
    End Sub

    Variations include
    ! vs .
    [Square brackets] rather_than_underscore
    and millions of combinations
    If I [Square Bracket] it tells me it "cant find the field "|" refered too"... That is the most annoying part of it all

  2. #2
    Join Date
    May 2010
    Posts
    339
    Do you want the current date? or the date from your table?


    Quote Originally Posted by Steven.Allman View Post
    I only want it to add a date to a field.

    Private Sub Command10_Click()
    Positive_Packets.RX_2nd_Request_Date = Date()
    End Sub

  3. #3
    Steven.Allman is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    118
    Current Date
    I use the email button for notification and then hit the update button so that it inputs a date (NOW) into the "2nd request" field

  4. #4
    Steven.Allman is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    118
    FYI, access 2007 will drop the () automatically. It is no longer needed

  5. #5
    Steven.Allman is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    118
    You know what, I dont have any reference to the current record. I am mildly retarded.. This has stumped me for a few hours.

  6. #6
    Steven.Allman is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    118
    Private Sub Command10_Click()

    [Positive Packets].[RX 2nd Request Date] = Date
    stLinkCriteria = "[Case Number]=" & "'" & Me![Case Number] & "'"
    End Sub

    Now my question grows... So how do I get that update to look at my particular record.

  7. #7
    Steven.Allman is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    118
    Here is my database, so you can see what I am trying to do. The data has all been deleted minus one FAKE record. The report shows the records that meet the query from the table. I want the button on the report to update the field on the table. The email button works great. I want the DATE button to work the same way. When I hit the email, it grabs the email address relevant to the record. When I hit update, I want to change the date only for that record..

  8. #8
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I have a report in my database that shows past due information. Each record has an Email and Update button.
    Do you mean you have a FORM with 2 buttons on it??? I don't have A2K7, but AFAIK, a report is view only - buttons don't activate on it (the report).

    Any chance you could convert the sample mdb to A2k3 (A2k) format?

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by ssanfu View Post
    I don't have A2K7, but AFAIK, a report is view only - buttons don't activate on it (the report).
    2007 introduced a new "Report" view that is interactive.

    Steven, you want something like this:

    Code:
    Option Compare Database
    Option Explicit
    
    Private Sub Command10_Click()
      Dim rstPositive_Packetslst  As DAO.Recordset
    
      Set rstPositive_Packetslst = CurrentDb().OpenRecordset("SELECT * FROM [positive packets] WHERE [Case Number]='" & Me![Case Number] & "'", dbOpenDynaset)
      rstPositive_Packetslst.Edit
      rstPositive_Packetslst![RX 2nd Request Date] = Date
      rstPositive_Packetslst.Update
      
      Set rstPositive_Packetslst = Nothing
    End Sub
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Comparing Date with current Date
    By ds_8805 in forum Forms
    Replies: 7
    Last Post: 03-31-2010, 09:31 PM
  2. Replies: 9
    Last Post: 03-19-2010, 10:37 AM
  3. VB coding to show current date n time in access form
    By cwwaicw311 in forum Programming
    Replies: 6
    Last Post: 02-10-2010, 09:53 PM
  4. Current Date Error
    By McFly in forum Database Design
    Replies: 4
    Last Post: 02-04-2010, 09:08 AM
  5. Changing a date to the current year
    By fdnyfish in forum Access
    Replies: 1
    Last Post: 03-01-2008, 08:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums