yes / no field query (1 Viewer)

7anthala

Registered User.
Local time
Today, 12:28
Joined
Apr 7, 2014
Messages
34
i have a table with yes / no field named cleared for checks.
i want to make a search form with combo box to query for cleared (yes) and not cleared (no) checks.

i tried combo box with values set in it, yes and no.
but it didnt work.
 

BlueIshDan

☠
Local time
Today, 06:28
Joined
May 15, 2014
Messages
1,122
Are you trying to have a form that displays a check box for every record?
I'm having a hard time trying to figure out your goal here. :)
 

7anthala

Registered User.
Local time
Today, 12:28
Joined
Apr 7, 2014
Messages
34
sorry if my question is not clear.
what i have is table that have yes / no field, and i have a search form with multiple fields as a criteria for a query, the text box and combo box are working good, but i tried to use a combo box for the criteria for the yes / no field but it didn't work.
the field is named cleared, so i want to query the cleared, not cleared, and both of them.

i hope im clear now, and hope you could help me.
 

Cronk

Registered User.
Local time
Today, 19:28
Joined
Jul 4, 2013
Messages
2,772
It's still vague what the issue is.

You have a table with let's say, four fields F1, F2, F3, F4 set as Yes/No fields. You have created a form with four unbound combo boxes with row source of Yes;No. You change the combos so you set some to No.

You now want to find those records in the table where the corresponding fields are No.

Then you say "it didn't work". What was supposed to happen then that did not work?
 

BlueIshDan

☠
Local time
Today, 06:28
Joined
May 15, 2014
Messages
1,122
Well since I cannot answer your question directly, what I will do is show you some pointers on how to use the combo box.

Code:
     [COLOR="SeaGreen"] ' Use breakpoint to follow along.[/COLOR]
      MsgBox cboCleared.Value

      cboCleared.Value = True
      MsgBox cboCleared.Value
      MsgBox CBool(cboCleared.Value)

      cboCleared.Value = False
      MsgBox cboCleared.Value
      MsgBox CBool(cboCleared.Value)
      
      MsgBox "INSERT INTO [table] (cleared) VALUES(" & CBool(cboCleared.Value) & ")"
 

7anthala

Registered User.
Local time
Today, 12:28
Joined
Apr 7, 2014
Messages
34
i appreciate your help, and sorry for not being clear.
i have found a solution, i placed this expression in the criteria field

IIf([Forms]![SEARCH]![Combo34]="Yes";Yes;No)

and it worked great.
and i need help to find both the yes and no records.
 

sumox

Registered User.
Local time
Today, 14:58
Joined
Oct 1, 2013
Messages
89
note:
The Table field of Yes/No is a Boolean type field
True or False is meant in internal coding of Access Queries.

So, Whenever you deal with Yes/No Fields, like
IIF([MyBurgerIsHot]...
then type
IIF([MyBurgerIsHot]= True, "Open your mouth", "Shut your mouth")

so, this is the thing .

Remember, Access means are equal for all of following
Yes/No in Tables
True/False in Queries
CheckBox in Forms

Okkey ! so i think i shud solving your queries and
if you still have some bubbles in mind, pls. feel free to Post HERE...

and by the way

Haf a Good Day
 

George21

Registered User.
Local time
Today, 12:28
Joined
Jan 10, 2011
Messages
26
Also, -1/0. You could create the query without code.

At the values input -1; "Yes"; 0; "No"
Column count 2
Bound column 1
 

Users who are viewing this thread

Top Bottom