If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Yes/No from TextBox in query
1. How to use values from [Form1]![Text1], in query?
Field in query is datatype Yes/NO. When I put in query criteria values Yes/No, working OK. But, when I call this values from [Form1]![Text1], not OK. 2. How to make... if is value NO query display all data with this parameter, and if is value Yes display parameter with Yes and NO? Thanks! |
#2
|
|||
|
|||
Yes/No from TextBox in query
Yes and No are not recognized values in VBA or Jet SQL. You need to use
eithe True or False. True = -1 False = 0 -- Dave Hargis, Microsoft Access MVP "Igor G." wrote: 1. How to use values from [Form1]![Text1], in query? Field in query is datatype Yes/NO. When I put in query criteria values Yes/No, working OK. But, when I call this values from [Form1]![Text1], not OK. 2. How to make... if is value NO query display all data with this parameter, and if is value Yes display parameter with Yes and NO? Thanks! |
#3
|
|||
|
|||
Yes/No from TextBox in query
2. How to make... if is value NO query display all data with this parameter,
and if is value Yes display parameter with Yes and NO? Did you mean to say both Yes and No if form input was Yes? If not then try using an IIF statement -- IIF([Forms]![Form1]![Text1] = "Yes", -1, 0) In this case your options are Yes, No, or All by just pressing ENTER at the prompt. IIf([Forms]![Form1]![Text1]="Yes",-1,0) Or Like IIf([Forms]![Form1]![Text1] Is Null,"*") -- KARL DEWEY Build a little - Test a little "Igor G." wrote: 1. How to use values from [Form1]![Text1], in query? Field in query is datatype Yes/NO. When I put in query criteria values Yes/No, working OK. But, when I call this values from [Form1]![Text1], not OK. 2. How to make... if is value NO query display all data with this parameter, and if is value Yes display parameter with Yes and NO? Thanks! |
Thread Tools | |
Display Modes | |
|
|