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

Show Selected Form Option in Query Result 1

Status
Not open for further replies.

penndro

Technical User
Jan 9, 2005
108
US
Hi,

I could really use your help with getting my query to show the option selected in my print options form.

There is an OPTIONS group that allows the user to select the currency conversion type to use in the query. The user can choose:

Local = 1
USD = 2
Both = 3

I want the selected option to show up in my query so my formulas are calculated based on the currency type needed.

My query request this:
PrintOpt: NZ([Forms]![frm_User Printing]![CurrOpt])

However it brings back nothing from the form. Can someone please tell me what I am doing wrong here?

I use [PrintOpt] in the query like this: IIF([PrintOPt]=1, then ...)
 
Looking at NZ help topic... the second parameter is only optional if you are not using it in a query.

Try this...
Code:
PrintOpt: NZ([Forms]![frm_User Printing]![CurrOpt], "")

I use [PrintOpt] in the query like this: IIF([PrintOPt]=1, then ...)

First, unless you change the NZ to return something you are testing for, I do not see the point of not using the full control reference instead of the alias.

Secondly your IIF looks odd syntaxtically like you are expecting to use "then" as part of the statement. It is hard to say since you did not include the actual expression.
 
NZ([Forms]![frm_User Printing]![CurrOpt],"")
Is brining back a null. It does not seem to connect with report. There is an option selected.
 
The query prompts me as if it is a parameter query. Instead of bringing back the value selected in the option box. It prompts me for an input of that that is...
 
Two thoughts... The value is not commited to the control, make sure you tab out of it. OR The form name / control name is incorrect in your reference.
 
It looks like you expect PrintOpt to be numeric so I would change:
Code:
NZ([Forms]![frm_User Printing]![CurrOpt],"")
to
Code:
Val(NZ([Forms]![frm_User Printing]![CurrOpt],0))


Duane
Hook'D on Access
MS Access MVP
 
dhookom - changing to VAL worked. Thanks so much you were spot on!

I apprecite all of you guys help so much.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top