Call functions (1 Viewer)

Charlie

Registered User.
Local time
Today, 02:21
Joined
Jan 7, 2000
Messages
16
Dear all,

I've created a button on all my forms that will update all the controls, subforms and list boxes on a form. What I'd like to do is call that function from outside the form, ie I need to update one form when something is changed on an unrelated form. I've made the button a "public sub" but when I call the button an error comes up saying "Invalid outside proceedure".

What am I doing wrong??

I'm using Access'97 pro SR2,

Thanks in advance,

Charlie
 

simongallop

Registered User.
Local time
Today, 02:21
Joined
Oct 17, 2000
Messages
611
The general code should be in a module and not the underlying code of a form. Secondly check that the focus of your general code is relating to the forms that you want to update.

Sorry that I can't be clearer, but if you need more help then will need more information such as the location of the code and details.

Final thought, when returning to view a form why not have the update code in the Got Focus event?
 

R. Hicks

AWF VIP
Local time
Yesterday, 20:21
Joined
Dec 23, 1999
Messages
619
Charlie as long as the form you want to run the procedure is open, you can call the procedure from a different form. The procedure is stored with the form it is connected to like an object, so it can be called the following way:

Forms![YourFormName].YourProcedureName

Of course this is an example, the names will have to be the correct names of your objects.

HTH
RDH
 

Users who are viewing this thread

Top Bottom