Can you have a Wildcard in Combo Box?

G

Guest

I have a report, based on a query, that uses a form for the criteria of the
query. It allows my users to view the different training reports on just
their folks and not the entire department. Is there a way I can have a
wildcard that shows ALL the records for the department (for the chief's use)?
The combo box is getting it's data from tbl.wrkarea.

Thanks!
 
G

Guest

You can use "Like" as the criteria, so if no value is selected in the combo,
it will return all records

Select * From TableName Where FieldName Like
Nz(Forms![FormName]![ComboName],"*")
 
G

Guest

This is what I did:

Select * From DATA Where PARA Like Nz(Forms![SELECT_WARD]![PARA],"*")

It sorts the data just fine (shows everyone if nothing is selected or sorts
by the selection), but the combo box does not come up anymore. I just get the
parameter box asking for Forms![SELECT_WARD]![PARA]. I've checked and checked
to make sure my syntax is correct for the combobox form. What else could I be
doing wrong.

Thanks for the help!!

Ofer Cohen said:
You can use "Like" as the criteria, so if no value is selected in the combo,
it will return all records

Select * From TableName Where FieldName Like
Nz(Forms![FormName]![ComboName],"*")


--
Good Luck
BS"D


SFC Traver said:
I have a report, based on a query, that uses a form for the criteria of the
query. It allows my users to view the different training reports on just
their folks and not the entire department. Is there a way I can have a
wildcard that shows ALL the records for the department (for the chief's use)?
The combo box is getting it's data from tbl.wrkarea.

Thanks!
 
G

Guest

I thought that the select belong to a report, and not to a combo.
If you are asked to enter the parameter while the report open's, it can mean
few things, either there is a syntax error in one of the names, or the form
is closed.

Mybe I'm not in the right direction, if so, please explain to me again what
are you trying to do, from your post I undertand that you are trying to
filter a report based on a combo value in a form.


--
Good Luck
BS"D


SFC Traver said:
This is what I did:

Select * From DATA Where PARA Like Nz(Forms![SELECT_WARD]![PARA],"*")

It sorts the data just fine (shows everyone if nothing is selected or sorts
by the selection), but the combo box does not come up anymore. I just get the
parameter box asking for Forms![SELECT_WARD]![PARA]. I've checked and checked
to make sure my syntax is correct for the combobox form. What else could I be
doing wrong.

Thanks for the help!!

Ofer Cohen said:
You can use "Like" as the criteria, so if no value is selected in the combo,
it will return all records

Select * From TableName Where FieldName Like
Nz(Forms![FormName]![ComboName],"*")


--
Good Luck
BS"D


SFC Traver said:
I have a report, based on a query, that uses a form for the criteria of the
query. It allows my users to view the different training reports on just
their folks and not the entire department. Is there a way I can have a
wildcard that shows ALL the records for the department (for the chief's use)?
The combo box is getting it's data from tbl.wrkarea.

Thanks!
 
G

Guest

To clarify, I want to sort the records on a form and a report. I want to do
this by using a combo box so that the parameter they chose is a valid
selection. I have been able to do it except for the ability to have a null
entry return ALL records (it works if they select something from the combo
box). I have it set up so that when they click the command button on the
switchboard to open the form or report, it opens another form that just has
the combo box and another command button that closes the combobox "form" and
lets the main form/report open with that selected criteria. Does that clear
it up or did I just muddy the water even more :)
Thanks so much for your time
SFC T

Ofer Cohen said:
I thought that the select belong to a report, and not to a combo.
If you are asked to enter the parameter while the report open's, it can mean
few things, either there is a syntax error in one of the names, or the form
is closed.

Mybe I'm not in the right direction, if so, please explain to me again what
are you trying to do, from your post I undertand that you are trying to
filter a report based on a combo value in a form.


--
Good Luck
BS"D


SFC Traver said:
This is what I did:

Select * From DATA Where PARA Like Nz(Forms![SELECT_WARD]![PARA],"*")

It sorts the data just fine (shows everyone if nothing is selected or sorts
by the selection), but the combo box does not come up anymore. I just get the
parameter box asking for Forms![SELECT_WARD]![PARA]. I've checked and checked
to make sure my syntax is correct for the combobox form. What else could I be
doing wrong.

Thanks for the help!!

Ofer Cohen said:
You can use "Like" as the criteria, so if no value is selected in the combo,
it will return all records

Select * From TableName Where FieldName Like
Nz(Forms![FormName]![ComboName],"*")


--
Good Luck
BS"D


:

I have a report, based on a query, that uses a form for the criteria of the
query. It allows my users to view the different training reports on just
their folks and not the entire department. Is there a way I can have a
wildcard that shows ALL the records for the department (for the chief's use)?
The combo box is getting it's data from tbl.wrkarea.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top