Call a marco on another form ?

  • Thread starter Thread starter SpookiePower
  • Start date Start date
S

SpookiePower

I have two forms - a mainform with a subform on it.

Most of my code are on the main form, but I have startede to wirte
some code on the subform. In the code on the subform I need to call
some code from my main form. How can I do that ?
I can remember from my old Delphi Pascal days, that you must include
units to get access to code from other places, but how can I do it here
??



www.photo.activewebsite.dk
 
are you using macros? or VBA code? macros are not saved as part of a form or
report, they're separate objects. to run any macro, just select the macro
name from the droplist of the event, in the Properties box.

hth
 
well, i've done it in VBA, but only once or twice, so i'd have to fiddle
around 'til i figured it out again, and i couldn't vouch that anything i
posted would be the "right" way to do it. suggest you hang with this thread
for awhile; if you don't get an answer by tomorrow, then suggest you re-post
the question in the
microsoft.public.access.modulesdaovba
newsgroup. don't use the word "macro" though; since macros and VBA code are
two different things in Access, you'll just confuse people! :)

hth
 
So long as the other form is open, and you've declared the VBA procedure in
that form "Public", you reference it by this syntax:

Form_NameOfTheForm.NameOfTheVBAProcedure
 
Back
Top