Hi,
I am fairly new to Access and VBA. I have found a few threads relating to my problem, but none have led to a solution, so if I hope that I am not restating an old question...
I am writing VBA code that emails users when their license is expiring. I want the email to include a report with a summary of the data we have on file for them as an attachment.
I have a query which is the RecordSource for the User Summary Report. I have a condition on the UserID field in the query that requests a UserID input which filters the report.
I was attempting to create a query in VBA with the condition UserID = intUserID a variable Ive stored per user.
What I'm stuck on, is this... Is it possible to have a saved query say "SummaryQuery" in my database to which I can, in VBA, apply the UserID variable filter temporarily and email a Report based on that temp query? Then reset it and send a report based on the next temp query, etc? Even a pointer as to what expressions I would need to do this would be great help.
Or is there another easier way that I'm not seeing?
Thanks for your help.