willem
08-09-2001, 04:30 AM
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
KeaganQuilty
08-09-2001, 06:31 AM
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
joeyreyma
08-09-2001, 03:22 PM
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.