smercer
Registered User.
- Local time
- Tomorrow, 08:15
- Joined
- Jun 14, 2004
- Messages
- 442
Hi all
I am trying to count the number of records a query is showing using VB & Dcount but the problem is it will count the source table and not the query. (Yes I have put the right criteria in as the query shows the right records at the right time.)
here is the code:
Also tried:
And
Cust_ID is a global variable, and when I put that in I get an error (See attachment)
This is for a set of buttons for when the customer is half way though a sale the customer wants to have another look around the user can click on number 2 button to serve other customers while waiting for previous customer. The program will then disable the "Sell books", "Return Books to stock" and "cancel sale" button because there are no books to sell for next customer yet.
When the user scans in books, the append query will use a number to identify which books go with whom and temporary store it in a field. This is the number I am trying to count.
Does anyone have any ideas? Thanks in advance
I am trying to count the number of records a query is showing using VB & Dcount but the problem is it will count the source table and not the query. (Yes I have put the right criteria in as the query shows the right records at the right time.)
here is the code:
Code:
Forms!frm_Book_Sales!sfrm_Sales_Book_Description_Current.Requery
Miscellaneous_Count = DCount("Customer_ID", "qry_Sales_Miscellaneous_Current", "")
Each_Book_Count = DCount("Customer_No", "qry_Sales_Each_Book_Current", "")
Also tried:
Code:
Forms!frm_Book_Sales!sfrm_Sales_Book_Description_Current.Requery
Miscellaneous_Count = DCount("*", "qry_Sales_Miscellaneous_Current", "")
Each_Book_Count = DCount("*", "qry_Sales_Each_Book_Current", "")
And
Code:
Miscellaneous_Count = DCount("Customer_ID", "qry_Sales_Miscellaneous_Current", "[Customer_ID] = Cust_ID")
Each_Book_Count = DCount("Customer_No", "qry_Sales_Each_Book_Current", "[Customer_No]= Cust_ID")
Cust_ID is a global variable, and when I put that in I get an error (See attachment)
This is for a set of buttons for when the customer is half way though a sale the customer wants to have another look around the user can click on number 2 button to serve other customers while waiting for previous customer. The program will then disable the "Sell books", "Return Books to stock" and "cancel sale" button because there are no books to sell for next customer yet.
When the user scans in books, the append query will use a number to identify which books go with whom and temporary store it in a field. This is the number I am trying to count.
Does anyone have any ideas? Thanks in advance
Attachments
Last edited: