query to show textbox

awake2424

Registered User.
Local time
Today, 00:04
Joined
Oct 31, 2007
Messages
479
Is it possible in access 2010 to create a a query that only shows a text box if a combo box criteria is met?

Example: On a form there is a combobox (Result) that can either be negative or positive. If the value is Negative then a query is already setup that populates a mailmerge with some text. If Results=Positive can a query be created that will show the textbox (Data). It only needs to show if the positive criteria is met. Thank you.
 
Yes it is possible.

Code:
If Combobox >= 0 then
  'Create a query
End If
 
So I put the code on the form (Test) in the Data (textbox), combobox (Result):
Code:
If [Result] >= 0 then [Data]
  'Create a query Show
End If

The Show query:
Code:
Show: IIf [(Result)] >=0 then "[(Data)]"

will simply selecting the show box only show this statement if true? Thanks.
 
I think it is a little mix up - could you show which result you want by some sample data.
As I read you post #1, you want to create a query if the combo box show a positive value, but that is not what you show in post #3, so you need to explain a little more.
 
I apologize for the confusion.

I have a combobox (Results) on a form (Test) and that combobox can have two values (either positive or negative). If negative is selected I have setup a query that will automatically fill in some generic text. If the Result is positive however I would like to have the text in (textbox Data) show up on the mail merge report. So Iff ([Results])="positive" then show forms!(Test)!(Data). Thank you.
 
Then try the below, remember to replace, "YourFormName", "YourComboBoxName" and "YouTextBoxIForm" with the correct names.
Code:
Expr2: IIf([Forms]![YourFormName]![YourComboBoxName].[value]>0;[Forms]![YourFormName]![YouTextBoxIForm])
 

Users who are viewing this thread

Back
Top Bottom