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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top