Solved

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

Posted on 2009-04-14
4
377 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
Comment Utility
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
Comment Utility
The form you are referring to must be open.
0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 250 total points
Comment Utility
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
Comment Utility
Thanks, Guys.

CRB
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Get an idea of what you should include in an email disclaimer with these Top 5 email disclaimer tips.
Outlook Free & Paid Tools
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now