Link to home
Start Free TrialLog in
Avatar of Clive Beaton
Clive BeatonFlag for Australia

asked on

can't find the form frm012Menu' referred to in a macro expression or VB code.

The code attached works for a form called frm010Login but not for a form called from102Menu (or quite a lot of other forms).  

Any ideas.

Thanks in advance
Public Function Test3()
 
   Dim frm As Form, ctl As Control, s As String
   Set frm = Forms!frm012Menu
   For Each ctl In frm
      Debug.Print ctl.Name
   Next ctl
 
End Function

Open in new window

Avatar of rockiroads
rockiroads
Flag of United States of America image

if thats the name of your form, put it in quotes, does it make a difference?

set frm = forms("frm012Menu")
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Clive Beaton

ASKER

Thanks, Guys.

CRB