Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to RunCode, Function Name question 2

Status
Not open for further replies.

eon5

Technical User
Dec 31, 2007
47
ZA
Access beginner
Hi,

Private Sub Form_Activate()
"I have code here that runs perfectly when i open the form"
end Sub

But I'm making use of a macro action "OpenForm" to open the form in a Dialog mode, but then the form ignores the "Form_Activate" procedure....

I see that i can call the code in the macro action "RunCode" selection...but what do i put in the "Function Name" option so to run the code...I have tried every thing but nothing, the form opens perfectly but the code does not run.

Thanks
Theuns
 
Why not using the Open or Load event procedures instead of the Activate ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thans for the advice PH,

But it is not about the load or open event procedure, the form is not calling the code when i open it in dialog mode.

The code "Form!VendorInformation!VendorList!.SetFocus" works perfectly when i open the form normally but when i open it with a macro so as to open it in Dialog mode then it does not set the focus to the vendor list, this tells me that it is not calling the code from the Dialog mode.
How do one set this up in the Macro.

Thanks
Theuns
 
How are ya eon5 . . .

[blue]PHV[/blue] didn't say it was about the [blue]Open or Load[/blue] event. [blue]For good reason[/blue], he suggested you move the code to one of these events . . . [blue]as am I![/blue]

In any case:
Microsoft said:
[blue]The Activate event doesn't occur when a form receives focus back from a dialog box, popup, or another form.[/blue]
Because of the above, this is an event that rarely gets used, and if you had read the info on this event in MS Help, you would've already known . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top