Can you enter multiple parameters?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In the Fund Number field criterion enter:
Like "*"&[Enter first Fund Number]&"*" or Like "*"&
[Enter second Fund Number]&"*"

Access treats each variation of text in the square
brackets as a separate parameter and will prompt for each
variation. The same text can be used multiple times in a
query if you intend that it be treated the same each time,
and Access will only prompt one time.

-----Original Message-----
I have a query that asks the user to input a Fund
Number. Is there a way (VBA or other) to ask the user if
they want to enter another Fund Number, then ask him to
enter the next Fund Number?
 
I looked more closely at your original question - you want
to prompt the user if he/she WANTS to enter a second
number, then allow a second entry if the user says Yes.
If this is the case try the following:

First, add a calculated field to your query, such as:
Choice2: [Two numbers? Y or N]
Uncheck the display box

Second, in the criteria field for the Fund Number, enter
two criteria, one for the first number, and an OR
criterion for the second number, as follows:
1st criterion: [Enter Fund Number]
2nd criterion: IIf([Two numbers? Y or N]="Y",[Enter
second number if you answered Y],[Enter Fund Number])

Note that the text strings for [Enter Fund Number] and
[Two numbers? Y or N] must be identical in their
respective locations so that Access will treat them as the
same parameters.
The user will be prompted for a second number in all
cases, but if he/she answered other than "Y" to the first
prompt, he/she may simply enter a null return to the
second number prompt, the entry will be ignored and only
records matching the first entry will be returned.

Also note that this syntax requires the user to input the
complete Fund Number(s) desired; if you want to prompt for
partial numbers, that requires incorporating wild cards
into the prompts, which is easily done if you wish.

Hope this works for you.

-----Original Message-----
In the Fund Number field criterion enter:
Like "*"&[Enter first Fund Number]&"*" or Like "*"&
[Enter second Fund Number]&"*"

Access treats each variation of text in the square
brackets as a separate parameter and will prompt for each
variation. The same text can be used multiple times in a
query if you intend that it be treated the same each time,
and Access will only prompt one time.

-----Original Message-----
I have a query that asks the user to input a Fund
Number. Is there a way (VBA or other) to ask the user if
they want to enter another Fund Number, then ask him to
enter the next Fund Number?
.
 
This worked just great. Thanks!

I looked more closely at your original question - you want
to prompt the user if he/she WANTS to enter a second
number, then allow a second entry if the user says Yes.
If this is the case try the following:

First, add a calculated field to your query, such as:
Choice2: [Two numbers? Y or N]
Uncheck the display box

Second, in the criteria field for the Fund Number, enter
two criteria, one for the first number, and an OR
criterion for the second number, as follows:
1st criterion: [Enter Fund Number]
2nd criterion: IIf([Two numbers? Y or N]="Y",[Enter
second number if you answered Y],[Enter Fund Number])

Note that the text strings for [Enter Fund Number] and
[Two numbers? Y or N] must be identical in their
respective locations so that Access will treat them as the
same parameters.
The user will be prompted for a second number in all
cases, but if he/she answered other than "Y" to the first
prompt, he/she may simply enter a null return to the
second number prompt, the entry will be ignored and only
records matching the first entry will be returned.

Also note that this syntax requires the user to input the
complete Fund Number(s) desired; if you want to prompt for
partial numbers, that requires incorporating wild cards
into the prompts, which is easily done if you wish.

Hope this works for you.

-----Original Message-----
In the Fund Number field criterion enter:
Like "*"&[Enter first Fund Number]&"*" or Like "*"&
[Enter second Fund Number]&"*"

Access treats each variation of text in the square
brackets as a separate parameter and will prompt for each
variation. The same text can be used multiple times in a
query if you intend that it be treated the same each time,
and Access will only prompt one time.

-----Original Message-----
I have a query that asks the user to input a Fund
Number. Is there a way (VBA or other) to ask the user if
they want to enter another Fund Number, then ask him to
enter the next Fund Number?
.
 
You're welcome, Tina. Glad it worked for you.

Just for completeness, you can test bracketing the Fund
Number criteria with wild cards to see if the query
returns the right records with only partial number input.
The crtieria would look like:
Like *"* & [Enter Fund Number] & "*"
and
Like "*" & IIf([Two numbers? Y or N]="Y",[Enter
second number if you answered Y],[Enter Fund Number])
& "*"

This way the user can input any part of the desired Fund
Number(s) and get records that contain the partial
string. This may be more than you want, but if the
numbers are long, it may be easier on the users. If the
first solution works well enough, leave it be - the KISS
principle should always be respected!

Good luck.

-----Original Message-----
This worked just great. Thanks!

I looked more closely at your original question - you want
to prompt the user if he/she WANTS to enter a second
number, then allow a second entry if the user says Yes.
If this is the case try the following:

First, add a calculated field to your query, such as:
Choice2: [Two numbers? Y or N]
Uncheck the display box

Second, in the criteria field for the Fund Number, enter
two criteria, one for the first number, and an OR
criterion for the second number, as follows:
1st criterion: [Enter Fund Number]
2nd criterion: IIf([Two numbers? Y or N]="Y",[Enter
second number if you answered Y],[Enter Fund Number])

Note that the text strings for [Enter Fund Number] and
[Two numbers? Y or N] must be identical in their
respective locations so that Access will treat them as the
same parameters.
The user will be prompted for a second number in all
cases, but if he/she answered other than "Y" to the first
prompt, he/she may simply enter a null return to the
second number prompt, the entry will be ignored and only
records matching the first entry will be returned.

Also note that this syntax requires the user to input the
complete Fund Number(s) desired; if you want to prompt for
partial numbers, that requires incorporating wild cards
into the prompts, which is easily done if you wish.

Hope this works for you.

-----Original Message-----
In the Fund Number field criterion enter:
Like "*"&[Enter first Fund Number]&"*" or Like "*"&
[Enter second Fund Number]&"*"

Access treats each variation of text in the square
brackets as a separate parameter and will prompt for each
variation. The same text can be used multiple times in a
query if you intend that it be treated the same each time,
and Access will only prompt one time.


-----Original Message-----
I have a query that asks the user to input a Fund
Number. Is there a way (VBA or other) to ask the user if
they want to enter another Fund Number, then ask him to
enter the next Fund Number?
.

.
.
 
gia
Ï "Tina said:
This worked just great. Thanks!

I looked more closely at your original question - you want
to prompt the user if he/she WANTS to enter a second
number, then allow a second entry if the user says Yes.
If this is the case try the following:

First, add a calculated field to your query, such as:
Choice2: [Two numbers? Y or N]
Uncheck the display box

Second, in the criteria field for the Fund Number, enter
two criteria, one for the first number, and an OR
criterion for the second number, as follows:
1st criterion: [Enter Fund Number]
2nd criterion: IIf([Two numbers? Y or N]="Y",[Enter
second number if you answered Y],[Enter Fund Number])

Note that the text strings for [Enter Fund Number] and
[Two numbers? Y or N] must be identical in their
respective locations so that Access will treat them as the
same parameters.
The user will be prompted for a second number in all
cases, but if he/she answered other than "Y" to the first
prompt, he/she may simply enter a null return to the
second number prompt, the entry will be ignored and only
records matching the first entry will be returned.

Also note that this syntax requires the user to input the
complete Fund Number(s) desired; if you want to prompt for
partial numbers, that requires incorporating wild cards
into the prompts, which is easily done if you wish.

Hope this works for you.

-----Original Message-----
In the Fund Number field criterion enter:
Like "*"&[Enter first Fund Number]&"*" or Like "*"&
[Enter second Fund Number]&"*"

Access treats each variation of text in the square
brackets as a separate parameter and will prompt for each
variation. The same text can be used multiple times in a
query if you intend that it be treated the same each time,
and Access will only prompt one time.


-----Original Message-----
I have a query that asks the user to input a Fund
Number. Is there a way (VBA or other) to ask the user if
they want to enter another Fund Number, then ask him to
enter the next Fund Number?
.

.
 
Back
Top