Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2008

Tip: Looking for answers? Try searching our database.

simple format question...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Kubicki - 13 May 2008 18:44 GMT
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

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.