I have a form 'FrmVandaag' with a subform 'SubFrmBijzZoVandaag' If i click on a record in the subform, a new form (FrmZichtorders) is opened with non depended text boxes. The form Frmzichtorders can be opened from from different forms that's why I declared the variable 'formuliernaam as string'.
In the form 'Frmzichtorders'is the following code to fill the fields based on an ID from the calling form.
With Forms(formuliernaam)
Me.Artikel = .Artikel
Me.Op_zicht_van = .[Op zicht van]
Me.Op_zicht_tot = .[Op zicht tot]
Me.Firma = .Firma
etc.
This method works perfect when 'formuliernaam' is a form (eg. formuliernaam = "frmoverzicht zichtorders") but if the calling form is a subform (eg. formuliernaam = "Forms!frmvandaag!SubFrmBijzZoVandaag.Form"), I get an error that the form cannot be found. How should i refer to the subform correctly? formuliernaam = ....
In the form 'Frmzichtorders'is the following code to fill the fields based on an ID from the calling form.
With Forms(formuliernaam)
Me.Artikel = .Artikel
Me.Op_zicht_van = .[Op zicht van]
Me.Op_zicht_tot = .[Op zicht tot]
Me.Firma = .Firma
etc.
This method works perfect when 'formuliernaam' is a form (eg. formuliernaam = "frmoverzicht zichtorders") but if the calling form is a subform (eg. formuliernaam = "Forms!frmvandaag!SubFrmBijzZoVandaag.Form"), I get an error that the form cannot be found. How should i refer to the subform correctly? formuliernaam = ....