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 &
"'")
 
Back
Top