code simplification question

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

Guest

Good morning,

I am trying to simplify my code. Instead of explicitly referencing my forms
in each loop, I am trying to make a variable that will house the base str and
then I just have to add specifics.... Of course if I'm writing it's because
I'm having problems with the synthax.


Dim FrmStr As String

FrmStr = "Forms![Drawing Management Frm]![Drawing Management Frm - Issue
Subfrm]![Drawing History Frm sous-formulaire]![Drawing Status Tbl subform]"

If IsNull(FrmStr.Form.Official) = False Then
...


I keep getting an invalid qualifier error? What is the proper way of doing
this?

Thank you,

Daniel
 
try the following:

Dim FrmStr As control

Set FrmStr = Forms![Drawing Management Frm]![Drawing Management Frm -
Issue Subfrm]![Drawing History Frm sous-formulaire]![Drawing Status Tbl
subform]

If IsNull(FrmStr.Form.Official) = False Then

pls also check the whole reference - Forms![Drawing Management Frm]![Drawing
Management Frm - Issue Subfrm]![Drawing History Frm
sous-formulaire]![Drawing Status Tbl subform]

normally you have to reffer to subforms like

Forms!MyForm!SubformControl.Form!SubformControl2.Form....


--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
 
Back
Top