0
votes

I'm working on an Access 2016 database for logging pass/fail conditions in my factory. I have everything I need if I want to run everything manually, now I want to automate my database.

I've got a report that pulls data from a query. When I run the report, the query's criteria prompt is triggered, asking for the date in mm/dd/yyyy format. Manually entering in the info works fine, but how can I create a macro that automatically puts a value into the prompt for me?

I've tried using the Macro design tool to "OpenReport" with the following Where Condition line:

Where Condition = [DailyReport Query]![LogDate] = Date()

However, when I run the macro, I still get the prompt to enter in the date. Am I missing something incredibly simple here? I'm still searching for the answer so, if I find it, I'll post it. Any and all help in the meantime is greatly appreciated!

1
Have you tried putting Date() in the query criteria field under Log Date instead of putting it in the macro?Huntdogg
I honestly didn't think of that...and that is much easier than what I was trying to do. Thanks for the easy solution! :)Alex
Glad I could assist you. There's usually more than one way to solve a problem in Access. If I helped solve your issue, please accept my answer as your solution.Huntdogg

1 Answers

1
votes

Instead, put Date() in the query criteria field under Log Date instead of putting it in the macro.