Results 1 to 3 of 3
  1. #1
    sephiroth2906 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    73

    Click button on form to fill in today's date on subreport/query

    Hello all,



    I have a form that I am using as a dashboard. There is a subreport that has data from a query that shows records that are due to have a postcard sent. The query returns records that have a date in one of the fields that is older than 7 days. There is another date field, Postcard_Sent, that, when present, will have those records no longer returned on the query.

    I have a button on the form. I want to be able to click that button and have today's date populate to the Postcard_Sent field in each record on the subreport/query.

    I tried
    Code:
    Private Sub cmdPostcardsSent_Click()
    Forms!Dashboard.subPostcards.Form.Postcard_Sent.Value = Date
    End Sub
    Which fills in today's date on the top record, but not all of the records.

    What do I need to change to have this field populate on all of the records that currently meet the query criteria and appear on the subreport?

    Thanks in advance!

  2. #2
    xps35's Avatar
    xps35 is online now Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    232
    Try an update query.
    Code:
    DoCmd.RunSQL "UPDATE YourTable SET Postcard_Sent = Date() WHERE {your condition here}"
    Groeten,

    Peter

  3. #3
    sephiroth2906 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2011
    Posts
    73
    Thanks Peter. That did the trick!

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

Similar Threads

  1. Replies: 4
    Last Post: 09-11-2022, 10:38 AM
  2. Replies: 6
    Last Post: 01-16-2022, 04:47 PM
  3. Replies: 14
    Last Post: 03-15-2018, 08:59 AM
  4. Replies: 6
    Last Post: 11-18-2013, 12:03 PM
  5. Replies: 5
    Last Post: 10-12-2012, 11:00 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