code simplification question

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
 
A

Alex Dybenko

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
 

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

Similar Threads


Top