form trivia

willem

Registered User.
Local time
Today, 23:56
Joined
Jun 17, 2001
Messages
41
How do i trigger the current event on a form.
Not just by going to the next record and then the previous.

How do i click a button without clicking it?

Last but not least, I have a form that contains a subform based on a query. When i click a button to open a new form i want the subform to close or at least i want to be able to be able to change the table on which the query is based.

Willem

Bye and thanks
 
Besides record navigation, why would you want to trigger the Current event of a form?

Command Button
You could hit Enter when the command button has focus, or
use HotKeys. In the Caption of the button, insert an ampersand (&) directly before the letter you wish to use, and then hit "Alt + letter"

SubForm
I don't know any way if making a subform close, short of making it invisible, and that would put a large ugly blank spot on your form. Changing the subform is easier.

Make a couple of different forms, each showing the different data you would like to display. Then when the button is clicked, change the SourceObject of the subformbox.

I hope I have sufficently answer your questions.

Keagan Quilty
Kilbride, Newfoundland
 
if you mean running the code behind the event procedures then you can. Like normal procedures or functions you can call them by their name, eg:

Private Sub Command0_Click(): Call Form_Current: End Sub

Private Sub Form_Current(): MsgBox "You can call this sub!": End Sub

clicking the Command0 button will call the Form_Current event. but one very important thing, be very careful when calling subs that has parameters, their are some issues you have to consider. however, i do not recommend calling an event procedure just to trigger the code behind, what i would do is create an independent sub.
 

Users who are viewing this thread

Back
Top Bottom