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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to test docmd query results

Status
Not open for further replies.

ktwclark

Programmer
Jan 30, 2002
54
0
0
GB
Hi

I'm using Access and have a query that returns the total number of records in another query. The field is called "Total". The Query is called "Totaller".

How do I transfer the result of the query in to a variable in VBA?

I currently have a text box called "txtTotal" on a form call "frmMain" bound to the "Total" field of the query result and am testing the text box's value after updating the query. The problem is the text box doesn't update to the new value of the query result after running the query.

Instead of using a text box I want to pass the result of the query to a variable and then conditional test the variable so I know I'm querying the most up to date result.

I'm trying to avoid using hard-coded SQL and ADO. I would prefer to use Access Queries which are invoked through the DoCmd function. I have no problems running queries, it's only accessing the "Total" field in the single record result that I'm having problems with.

Any help would be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top