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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DCount syntax problem

Status
Not open for further replies.

Binnit

Technical User
Apr 28, 2004
627
US
I have 2 Dcount statements that I need to join the WHERE clauses.

Both statements work correctly independantly but when I try to add an AND and join it together it fails, I am presuming this to be a syntax issue and have tried many variances to get it right but so far no success.

Any help appreciated.

Code:
DCount("[CNNumberFrom]", "tblCoverNotes", "[CNIssuedTo] =" & Me.txtIssuedTo)

DCount("[CNNumberFrom]", "tblCoverNotes", "[CNRSABookType] ='" & Me.txtCNRSABookType & "'")

What I need is the internal syntax to make the following WHERE clause work:-
DCount("[CNNumberFrom]", "tblCoverNotes", "[CNRSABookType] = Me.txtCNRSABookType AND [CNIssuedTo] = Me.txtIssuedTo")


[CNRSABookType] is a String
[CNIssuedTo]is a number


Happiness is...not getting what you want but wanting what you have already got
 
OK, I got it.....at last!

Code:
DCount("[CNNumberFrom]", "tblCoverNotes", "[CNRSABookType] ='" & Me.txtCNRSABookType & "' And [CNIssuedTo] = " & Me.txtIssuedTo)

Happiness is...not getting what you want but wanting what you have already got
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top