i've built a form with a Combo box that works well as the criteria selection tool, to run a query that returns and displays the data in a subform
and also serves as the recordSource for a report.
The query gets it's criteria from the combobox: eg Where (TblTransactions.Type) =[Forms]![FrmTransactions]![Textvalue]
This works well but the User also wants the option to clear the Combobox and see ALL Records (ie Unfiltered data) and
view/print the corresponding report with ALL records listed.
I was able to clear the contents of the Combobox with the simple commands:
Me.ComboType.SetFocus
Me.ComboType.Text = ""
I've tried an iif statement in the query to show all records when the combobox is Empty but it returns 0 records:
the sql WHERE Clause is something like:
Where (TblTransactions.Type) =IIf([Forms]![FrmTransactions02]![ComboType].[Text]="",([TblTransactions].[Type]) Like "*",[Forms]![FrmTransactions02]![Textvalue]))
Is there a way to get this to work or Is there a better way to toggle the query from displaying selected records and
ALL records based on the form Controls???
thanks for any suggestions offered!
and also serves as the recordSource for a report.
The query gets it's criteria from the combobox: eg Where (TblTransactions.Type) =[Forms]![FrmTransactions]![Textvalue]
This works well but the User also wants the option to clear the Combobox and see ALL Records (ie Unfiltered data) and
view/print the corresponding report with ALL records listed.
I was able to clear the contents of the Combobox with the simple commands:
Me.ComboType.SetFocus
Me.ComboType.Text = ""
I've tried an iif statement in the query to show all records when the combobox is Empty but it returns 0 records:
the sql WHERE Clause is something like:
Where (TblTransactions.Type) =IIf([Forms]![FrmTransactions02]![ComboType].[Text]="",([TblTransactions].[Type]) Like "*",[Forms]![FrmTransactions02]![Textvalue]))
Is there a way to get this to work or Is there a better way to toggle the query from displaying selected records and
ALL records based on the form Controls???
thanks for any suggestions offered!