i am looking for the number of records that satisfy 2 criteria:
(both Manufacturer and CatalogNumber are text fields)
this line of code works:
x = DCount("[Manufacturer]", "FixtureCataloges", "[CatalogNumber]= '" &
Me.vcmbCatalogNumber & "'")
this line of code works:
x = DCount("[Manufacturer]", "FixtureCataloges", "[Manufacturer] = '" &
Me.vcmbManufacturer & "'")
but, when i combine them, it doesn't work:
x = DCount("[Manufacturer]", "FixtureCataloges", "[Manufacturer] = ' " &
Me.vcmbManufacturer & " ' " And "[CatalogNumber]= ' " & Me.vcmbCatalogNumber
& " ' ")
thanks in advance,
mark
Douglas J. Steele - 13 May 2008 19:03 GMT
Your quotes around the And are wrong:
x = DCount("[Manufacturer]", "FixtureCataloges", "[Manufacturer] = ' " &
Me.vcmbManufacturer & " ' And [CatalogNumber]= ' " & Me.vcmbCatalogNumber &
" ' ")
(Of course the spaces around the single quotes need to be removed)

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
>i am looking for the number of records that satisfy 2 criteria:
> (both Manufacturer and CatalogNumber are text fields)
[quoted text clipped - 14 lines]
> thanks in advance,
> mark
Klatuu - 13 May 2008 19:08 GMT
x = DCount("[Manufacturer]", "FixtureCataloges", "[Manufacturer] = """ &
Me.vcmbManufacturer & """ And [CatalogNumber] = """ & Me.vcmbCatalogNumber
& """")

Signature
Dave Hargis, Microsoft Access MVP
> i am looking for the number of records that satisfy 2 criteria:
> (both Manufacturer and CatalogNumber are text fields)
[quoted text clipped - 14 lines]
> thanks in advance,
> mark