Solved

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

Posted on 2009-04-14
4
382 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 250 total points
ID: 24135900
The form you are referring to must be open.
0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 250 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

807 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