VB code based on different forms loaded

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I have a Database that i use for taking ordes, the form is called
frmOrder

I have now created a very simply vertions of frmOrder called
frmOrderTill that is will be used in our shop ( does same stuff but
very basic

Hoever some of the subform replating to frmOrder and now frmORderTill,
have code in it that refers back to frmOrder, is there a way to write
the code so it can use either frmOrder or frmOrderTill depending on
what form is open

Example of code used
Forms![frmOrderProductAdd]![frmOrderProductTopBar].Form![OrderNumber]
= Forms![frmOrder]![OrderNumber]

i need a way to it will use either Forms![frmOrder]![OrderNumber] or
Forms![frmOrderTill]![OrderNumber]
 
If these are truly Forms embedded in Subform Controls, which Subform
Controls are in both frmOrder and frmOrderTill, then you can refer back to a
control on the parent form with this code in the Form in the Subform
Control:

Me.Parent!<ControlName>

Some people (wrongly) use "subform" to refer to any form that is opened from
another form... this would not work for that case.

Larry Linson
Microsoft Office Access MVP
 
Back
Top