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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wildcard characters from Combo boxes for report

Status
Not open for further replies.

vmolasi

Programmer
Aug 13, 2003
12
FR
Hello Experts,
I have an application wherein I am generating a report with the help of criteria specified through 4 Combo boxes on a form. These Combo boxes pick up data via a data selection query from the fields of a Table. The problem is that when for one of the combo boxes I do not specify a value the report comes up blank (as one or more of the AND conditions specified in the the SQL statement of the query underlying the report are not satisfied). I want to change this, such that when i do not specify any value in the combo box, it should consider this as a wildcard "*" and select all the records for the report.
 
Try changing the criteria for that combo box to something like this:
Code:
Like [YourComboBoxReferenceHere] & "*"
If nothing is selected in the combo box all records will be returned, otherwise just the one selected will....

Hoc nomen meum verum non est.
 
Hi CosmoKramer,

The following is SQL statement of the query underlying the report. Here Audittrail is the table, Temp is the form name and Usernamebox is the combo box in the form from where I select the criterion for the report.


SELECT Audittrail.*
FROM Audittrail
WHERE ((Audittrail.Username)=[Forms].[temp].[Usernamebox]);

Cheers
Auf wiedersehen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top