Run macro if table field value = today

  • Thread starter Macro condition based on date
  • Start date
M

Macro condition based on date

what is the conditional code to add to a macro to run a macro if today's date
is <> to the last update date I store in a table (only 1 record in table)?
Access does not like [LastUpdate]![Last_Updt_Date]=Date().
 
K

KARL DEWEY

'Today's date is <> to the last update date' is the opposite of
[LastUpdate]![Last_Updt_Date]=Date().
If you want the dates to not be the same then use --
[LastUpdate]![Last_Updt_Date]<>Date()
If your field [Last_Updt_Date] has a time component then it will not match
Date().
You would need to remove the time like this --
[LastUpdate]![Last_Updt_Date]=Int(Date())
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top