Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solved.....Help with And in Dlookup statement (Number Value and Text Value) from form

Status
Not open for further replies.

MightyRoo

Programmer
Jan 5, 2005
22
0
0
US
Hello,

I can get the following to return the results I need....

(BrandIdLink is a number)
Code:
NumberOfModels = DCount("[XModelIDLink]", "QryBrandsWithMultipleModels", "[XBrandIDLink] = " & Me.BrandIDLink)

And
(DeviceType is text)
Code:
                                        NumberOfModels = DCount("[XModelIDLink]", "QryBrandsWithMultipleModels", "[XDeviceType] = '" & [DeviceType] & "'")

However, as hard as I try I cannot get them together without errors.

Help would truly be appreciated.

Thanks,

Scott

 
Got it.....
Code:
NumberOfModels = DCount("[XModelIDLink]", "QryBrandsWithMultipleModels", "[XBrandIDLink] = " & Me.BrandIDLink & " and [XDeviceType] = '" & [DeviceType] & "'")

And then Finally

Code:
NumberOfModels = DCount("[XModelIDLink]", "QryBrandsWithMultipleModels", "[XModelIDLink] = " & Me.ModelIDLink & " AND [XBrandIDLink] = " & Me.BrandIDLink & " and [XDeviceType] = '" & [DeviceType] & "'")


Hopefully this helps someone else!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top