Modules from Form to Form

D-Fresh

Registered User.
Local time
Today, 21:38
Joined
Jun 6, 2000
Messages
225
For some reason, I can't get this working for me... Seems very simple, but yet I'm blank.. How can I call one forms subroutine from another form? Basically, I have a form open, then I open up another form and call a subroutine off of it, and then close the second form down.. I don't seem to have the syntax correct on how to refer to the subroutine. I have the subroutine declared as a public sub... Any help would be greatly appreciated..
 
I'm not %100 sure, but I don't believe you can do what you are trying to do. Let me get this straight, you have a routine defined within the code module of a specific form, and you are trying to use another form to run that routine? Of course I don't know what you're doing, but that sounds like a very odd thing to do to me. Anyway, why don't you put the routine inside a separate Module object? That way any Form or Report or other Module or whatever could access the routine.
 
Okay, here is what I'm trying to do.... I have a form that has an ActiveX Calendar on it... The user has a choice of picking a single date or a date range... I open the calendar and let the user make their choice and variables get defined from what they select... Basically, the calendar has option buttons to choose single date or range... The form defaults to single and when range is selected, a control for end date is made visible on the got focus event... I want to make range the default choice when I open it from a specific form, so I need to make that end date option visible, which I created the code in a subroutine... Now that I'm thinking about it... Is it better just to make the form variations through the original form, instead of calling it through a subroutine? Sorry if this sounds confusing.... It makes sense to me.. hehe... Thanks again..
 
Alright, never mind.. I got it.. I just explicitly changed the properties of the controls from the original module... You know, it seems that things become a lot clearer when you write them down... Thanks for the help, it is greatly appreciated.

Doug
 

Users who are viewing this thread

Back
Top Bottom