call a sub from a seperate object

JonatABS

Registered User.
Local time
Today, 04:14
Joined
Dec 16, 2002
Messages
114
call a sub from 2 different sunforms

Ok this is a first for me so mind my dumbness

youknow how in the VB editor, you have on the left hand side all your forms. You click on on and you see all the subroutines for that one form.

How do you call a subroutine from two different forms.

The reason im doing this is because im trying to requery a list on a subform on a tabed main form.

the list will not requery no mattter what I do. The only way is to hit the ok button on the subform of the list I want to requery.

I havent found a solution so I figured if I called that subroutine where the button is that it would work the same way. As me pushing the button myself.

This is all happening on the ON_CLICK function of the tab on the main form.

Am I wrong?

Ppl have tried to help with no success they gae me the following code.

Forms![mainform]!subform!list.requery or something to that effect.

It doesnt work.

thanks
 
Last edited:
To call a subroutine or function from 2(or more) forms:

1) go the the Modules tab
2) create a New module
3) make a "Public" sub or function
4) call from any form

HTH,
RichM
 
Do you then have to call that module from the function or what?
 
Damnit!

Ok for the onclick event of the tab (Number of cows)
I put

CALL MODULE1

In the Module 1 I put
CALL [Form_cowstotal subform]
GOTO Cowstotal_click

(This is the same routine I use to refresh the list when I click a button on the subform)

What am I doing wrong?

In theory when I click on the tab it should requery the list on the subform right???
 
Last edited:

Users who are viewing this thread

Back
Top Bottom