Add One Condition!

B

Bob V

Can this be added to "tblHorseDetails.Invocing=No" So as The Yes Records are
eliminated
tblHorseDetails.Invoicing is a Yes/No Field
Thanks if you can help me with this...............Bob

recHorseOwners.Open "SELECT OwnerID,OwnerPercent FROM tblHorseDetails" _
& " WHERE HorseID=" _
& val(tbHorseID.value) & " AND OwnerID > 0 ORDER BY OwnerID ",
CurrentProject.Connection, adOpenDynamic, adLockOptimistic
 
B

Baz

recHorseOwners.Open "SELECT OwnerID,OwnerPercent FROM tblHorseDetails" _
& " WHERE HorseID=" _
& val(tbHorseID.value) & " AND OwnerID > 0 AND Invoicing = False
ORDER BY OwnerID ",
CurrentProject.Connection, adOpenDynamic, adLockOptimistic
 
B

Bob V

Nick when I enter this code I am getting a Red Error on
ORDER BY OwnerID ", and its still selecting owners that are True
Thanks for your help..........Bob
 
B

Baz

Getting it highlighted in red means you have mis-typed something. Make sure
that all the quotation marks are exactly right, and that any line breaks
have underscore line continuation characters (news readers often insert
unwanted line wraps so it's possible that by now you have line breaks which
neither you or I intended).

However, if it's highlighted in red, the code will neither compile nor run,
so I don't see how it can be returning anything at all...
 
Top