Parameter Query with Parameter in If Statement

R

Randal

Is there a way to put an unknown parameter in an If statement, but only have
the query ask for the parameter when the criteria is met. Example:

Field3: IIf([Table1]![Flag]="Yes",[Table1]![Name],[enter your own name])

This asks me for the parameter even if the flag is set to "Yes" and I only
want it to ask when flag is not = "Yes"
 
F

Frank Stone

I'm not sure but it sounds like you've confused the issue.
access ran into a record that was not yes and is asking
for input. problem is you don't know which record it is
asking input for. I don't think I would try this method.
"enter your own name" sounds like someone other than you
is doing the input which cofuses me. If you are doing the
input, i would just write a select query where field3
 
R

Randal

This particular table will always only have one record. It is a made table
that is created by either grouping a bunch of records where I want the user
to assign a name --- or a single record where I can use the actual name.
But I agree with you that this was probably not the best approach. I would
up using a condition on a macro.

Frank Stone said:
I'm not sure but it sounds like you've confused the issue.
access ran into a record that was not yes and is asking
for input. problem is you don't know which record it is
asking input for. I don't think I would try this method.
"enter your own name" sounds like someone other than you
is doing the input which cofuses me. If you are doing the
input, i would just write a select query where field3
-----Original Message-----
Is there a way to put an unknown parameter in an If statement, but only have
the query ask for the parameter when the criteria is met. Example:

Field3: IIf([Table1]![Flag]="Yes",[Table1]![Name],[enter your own name])

This asks me for the parameter even if the flag is set to "Yes" and I only
want it to ask when flag is not = "Yes"


.
 

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