Sub Form Main Form Value

  • Thread starter Thread starter LJG
  • Start date Start date
L

LJG

Can anyone confirm this is the correct way to get a value from a field from
another form

=[Forms]![frmGoodsReceipt].[txtsup]

The field txtsup gets its value from a combo box on the main form.

I need the value as I have a combo box on the subform that will limit the
items in a combo box.

TIA
 
That's how to get a value from another form (although it's technically more
correct to use =[Forms]![frmGoodsReceipt]![txtsup]), but your subject line
mentions "sub form", and that's not how to get a value from a subform.

As far as Access is concerned, the form that's acting as the subform isn't
actually part of the Forms collection (the list of open forms). To refer to
a control on a subform, you'd use
Forms!NameOfParentForm!NameOfSubformControl.Form!NameOfControlOnSubform

Note that NameOfSubformControl may or may not be the same as the name of the
form being used as a subform. If you created the form/subform relationship
by dragging one form onto the other, the names should be the same. If you
added the subform control from the tool box then provided the necessary
information to set up the form/subform relationship, the subform control
will likely be named something like Child0 (where the digit will vary)
 
Back
Top