Call another's form procedure...

polina

Registered User.
Local time
Today, 00:16
Joined
Aug 21, 2002
Messages
100
Hi

From form1's code, I open form2 assigning some of the fields values.

DoCmd.OpenForm "Form2"
Form_Form2.ModelID = Me.ModelID
Form_Form2.PIN_SerialNumber = Me.PIN_SerialNumber


Could I also call one of the Form2 procedures from within the form1's code?

Thanks
 
If the possibility exists that you will continue to use this procedure on other forms, perhaps you should consider placing it in a module so you can call it from anywhere in the database.

Paul
 
Well, the thing is it is not really a procedure, it is just a sub...so I wouldn't place it to the module.
 
I understand where you are coming from but writing a function and placing it in the module may still be something to consider instead of creating similar subs on a bunch of forms. I often make my own buttons (for example, to move to the next record, previous record, etc.) and place the code in a module. I write all the error handling in the function and use one line in the code behind my forms to call it. In the long run, it saves me time and space in my database.

Just something to think about. Good luck.

Paul
 

Users who are viewing this thread

Back
Top Bottom