query select

awake2424

Registered User.
Local time
Today, 16:26
Joined
Oct 31, 2007
Messages
479
Is it possible to insert text from a textbox on a form (Data) when a combobox on (Data) meets a criteria?

Example: Test: IIf([Results]="Positive" “Text207”)

So if the Results combobox is Positive then the text from Text207 is inserted. Thanks.
 
So then if the form is Data, Results is the criteria, and Text207 is the textbox:

Test: IIf([Results]="Positive" “Data.Text207”) is the correct syntax? Thank you.
 
That's not the correct syntax for the IIf() or the form reference, and you wouldn't want quotes around the form reference. Note on that link "Forms!" is part of the reference.
 
form is Data, Results is the criteria, and Text207 is the textbox:

test: [Forms]![Data]![Text207] but I'm not sure how to use a IIf() criteria.

Thank you very much.
 
Did you look in help?

IIf([Results]="Positive", [Forms]![Data]![Text207], "")
 
Thank you for your help... I can not access the help file for some reason and need to re-install Access.
 
When I put this into the query and try to run it: "Enter Parameter Value" results. Also, the mail merge document that it was linked to does not work unless that code is removed. Thanks.

Test: IIf([Results]="Positive",[Forms]![Data]![Text207],"")
 
The form would have to be open; is it? I've never needed to do a mail merge from Word, so not sure I can help with that. I just create Access reports and do the equivalent of a mail merge with them.
 

Users who are viewing this thread

Back
Top Bottom