Select Where Yes/No (1 Viewer)

dlugirapfr

Registered User.
Local time
Today, 06:39
Joined
Nov 22, 2012
Messages
68
Dear All,

I want to write code to select records where field yes/no will be selected on yes.
I wrote code like this
Code:
Set rs = Mydb.OpenRecordset("SELECT * from tblCalc WHERE ((tblCalc.taknie)=Yes)")
tblCalc.taknie - it is yes no field.

I allays has the Error 13 problem, I tried:
tblCalc.taknie=Yes
tblCalc.taknie=0
tblCalc.taknie="1"
tblCalc.taknie=-1

And still the same problem. I use MS Access 2003. Thanks for any replay.
 

Mihail

Registered User.
Local time
Today, 07:39
Joined
Jan 22, 2011
Messages
2,373
Try this:
Code:
Set rs = Mydb.OpenRecordset("SELECT * from tblCalc WHERE taknie= -1")
 

DavidAtWork

Registered User.
Local time
Today, 05:39
Joined
Oct 25, 2011
Messages
699
since Yes/No fields are treated as True/False try this:
Set rs = Mydb.OpenRecordset("SELECT * from tblCalc WHERE tblCalc.taknie= True")

David
 

Users who are viewing this thread

Top Bottom