|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a form(frmMainWorkflow) that I use to create, edit, or view records. I also have a form(frmMenuStart) that calls to frmMainWorkflow in a couple of different ways. The condition I'm working on now is a search function that uses a text box that has the search criteria and three option buttons in a group(open, closed, all). I need to filter the query for frmMainWorkflow by using these options. The qryMainWorkflow uses two tables tblMainWorkflow and tblEDMOlist, each record has a check box called IsClosed to mark the record if it is closed. Can someone point me to, or give me, a good example of using option groups in this type of situation?
Sopedaddy Last edited by sopedaddy : January 18th, 2005 at 02:32 PM. Reason: more detail |
|
#2
|
|||
|
|||
|
Sopedaddy,
One of the problems using an option group(open, closed, all) is that each button will require a value which can be a negative, zero or a positive value but not Null. However a check box has only two values -1 (Yes) and 0 (No). Which means you can set the open, closed buttons to those values, but to retrieve all the records the option group will have to have a Null. You can use the IIf statement to simulate a Null and then work that into your query for the criteria. A typical SQL of a query using this example would look something like this: SELECT TableName.* FROM TableName WHERE (((IIf([Forms]![FormName]![OptionGroupName]=-1 Or [Forms]![FormName]![OptionGroupName]=0,[Forms]![FormName]![OptionGroupName])) Is Null)) OR (((TableName.CheckBoxName)=IIf([Forms]![FormName]![OptionGroupName]=-1 Or [Forms]![FormName]![OptionGroupName]=0,[Forms]![FormName]![OptionGroupName]))); lwells |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Filter for Query using text box and option group |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|