Subforms and IIF Statement

N

Nanette

I have the following:

Main Form: frmPricingInput
Sub Form: sfrmPricingInputA
Sub Sub Form: sfrmPricingInputB (this form is a subform in sfrmPricingInputA)

I have a text box (Program Name) in the sfrmPricingInputB subform.

I would like the Program Name text box to change automatically (only 2
options: New Materials or Replacements) based on the text box (RFQType) in
frmPricingInput (main form).

I was thinking of creating an IIF statement, but am not sure if this is the
correct way to go. What is the best way to do this?

I'm a beginner (and pretty bad at VBA), so please be as specific as you can.

Thanks in advance for your help.
 
M

Michel Walsh

If your subform already has the two controls (can be made invisible for the
presentation to the end user), NewMaterials and Replacements, then, probably
something like:


= iif( FORMS!MainFormNameHere!RFQType = 'Replacements', Replacements,
NewMaterials )

as formula for the ProgramName control (which, I assume, is in the same
subform that Replacements and NewMaterials, take a look at
http://www.mvps.org/access/forms/frm0031.htm if not).


Hoping it may help,
Vanderghast, Access MVP
 
N

Nanette

Thanks Michel!

It worked. I feel like the mad scientist that discovered something :)))
 
Top