Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass Count from Query to message box

Status
Not open for further replies.

cdck

Programmer
Nov 25, 2003
281
US
I have a query that counts the number of records in a selection which meet a certain criteria. I need to run that query, then run another query which modifies all of those records, then pop up a message box telling the user how many records were just modified, using the count from the first query.

I can set up a macro to run one query, then the next, then pop up the message box, then exit the database, but I do not know how to get the count from the first query into the message box. My intention was to set up such a macro, convert it into a module, and then adapt the code as needed. I'm not doing it straight in a module because I am a newbie in the VBA portion of Access.

Can anyone give me direction on how to proceed, including, if applicable, a pointer to any resources that talk about this?

I apologize if this has been covered before, with the site's search function down, I'm having no luck finding anything similar through the google option.


Cheryl dc Kern
 
Have a look at the DLookUp or DCount function.

BTW, if SetWarnings is False then the message box telling the user how many records would be modified pop up automatically ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top