Subforms and IIF Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 

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

Back
Top