?
Solved

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

Posted on 2009-04-14
4
Medium Priority
?
391 Views
Last Modified: 2013-11-27
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

0
Comment
Question by:CRB1609
  • 2
4 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 24135888
if thats the name of your form, put it in quotes, does it make a difference?

set frm = forms("frm012Menu")
0
 
LVL 77

Accepted Solution

by:
peter57r earned 1000 total points
ID: 24135900
The form you are referring to must be open.
0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 1000 total points
ID: 24135904
ah, it just clicked

form isnt open therefore it cant find it

so open the form, you can open it hidden also

eg open form for edit but hidden

    DoCmd.OpenForm "form1", acDesign, , , acFormEdit, acHidden

0
 

Author Closing Comment

by:CRB1609
ID: 31569809
Thanks, Guys.

CRB
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question