Parameterized query

  • Thread starter Thread starter seans
  • Start date Start date
S

seans

Hello,

Please, can somebody help me? I am using a form to take in parameters
for an Access query. The values are entered into various text fields
in the dialog. Is there a way that I can ignore any text fields which
are left empty? I tried using this in the criteria but it doesn't seem
to work.

IIf([Forms]![Search]![Number],Like "*" & [Forms]![Search]![Number] &
"*","")

Search is the name of the form. Number the name of one of the text
fields. I basically don't want any criteria to appear if the text
field is blank.

thanks in advance.

sean
 
Number the name of one of the text fields.
I assume you do not mean ‘field’ but TextBox.
Again I assume you do not mean ‘field’ but TextBox.


Like IIf([Forms]![Search]![Number] Is Null, "*", [Forms]![Search]![Number])


seans said:
Hello,

Please, can somebody help me? I am using a form to take in parameters
for an Access query. The values are entered into various text fields
in the dialog. Is there a way that I can ignore any text fields which
are left empty? I tried using this in the criteria but it doesn't seem
to work.

IIf([Forms]![Search]![Number],Like "*" & [Forms]![Search]![Number] &
"*","")

Search is the name of the form. Number the name of one of the text
fields. I basically don't want any criteria to appear if the text
field is blank.

thanks in advance.

sean
 
KARL said:
I assume you do not mean 'field' but TextBox.
Again I assume you do not mean 'field' but TextBox.


Like IIf([Forms]![Search]![Number] Is Null, "*", [Forms]![Search]![Number])


seans said:
Hello,

Please, can somebody help me? I am using a form to take in parameters
for an Access query. The values are entered into various text fields
in the dialog. Is there a way that I can ignore any text fields which
are left empty? I tried using this in the criteria but it doesn't seem
to work.

IIf([Forms]![Search]![Number],Like "*" & [Forms]![Search]![Number] &
"*","")

Search is the name of the form. Number the name of one of the text
fields. I basically don't want any criteria to appear if the text
field is blank.

thanks in advance.

sean

It's working now. Thanks to both of you for your help.

sean
 

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

Back
Top