simple format question...

  • Thread starter Thread starter Mark Kubicki
  • Start date Start date
M

Mark Kubicki

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
 
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)
 
x = DCount("[Manufacturer]", "FixtureCataloges", "[Manufacturer] = """ &
Me.vcmbManufacturer & """ And [CatalogNumber] = """ & Me.vcmbCatalogNumber
& """")
 
Back
Top