Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using wildcard * in a combobox on form to generate report

Status
Not open for further replies.

drrep

Programmer
Mar 13, 2002
47
0
0
US
Hi,

I have a combo box in my form. Now I have 5 values in there including a value called ALL. I want that ALL to display all the data in a table, and not filtered by a specific value.
(like saying SELECT * from table)

Problem is that when I select ALL from the combobox, I change the value of the combobox to * for the query to pick up all data but then I get nothing as results in my report.

If I go to the query itself, and enter * in the criteria where I specified Like [Forms]![Testform]![ComboField] , it works just fine

Any ideas?

 
1.Create a query like "Select * from table1" and assign to report.
2.To filter the result based on selection.
In Report_Open Event Check for User selections.Below is Example.

strFilter = "[TransDate] Between #" & Forms![yReport Selection Screen]![From Date] & "# "
strFilter = strFilter & "AND #" & Forms![yReport Selection Screen]![To Date] & "# "
If Trim(&quot;&quot; & Forms![yReport Selection Screen]![Selection Criteria]) <> &quot;*&quot; Then
strFilter = strFilter & &quot; AND [ItemNumber] = '&quot; & Forms![yReport Selection Screen]![Selection Criteria] & &quot;'&quot;
End If
Me.Filter = strFilter
Me.FilterOn = True

Note:Assuming your report selection form is loaded
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top