Having problems using DCount

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create a Dcount that will display the amount of orders that there
has been for that particular customer.
But I want it decide which customer i am counting based on a combobox that
has the customer information. I am trying to add this onto the NORTHWIND
database, and i want it to use the combobox that i choose the customer from
to decide. I nead this to be on the orders form.
Can someone please show me an example of the code that i should use. the
table names and the field names are the same as on the northwind database.

thank you
 
Generic (hint: it helps if you provide actual names when you post) example:

If the combo box is a numeric value:
MyCount = DCount("*", "TableName", "FieldName=" & Me.ComboboxName.Value)

If the combo box is a text value:
MyCount = DCount("*", "TableName", "FieldName='" & Me.ComboboxName.Value &
"'")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dcount question 6
Dcount Problem 2
Access MS Access DCount function problem 0
adding records to a sub form 2
DCount within a Group 2
Automatic Updates 4
Using a form to supply DCount Criteria 21
dcount 1

Back
Top