chrisjames25
Registered User.
- Local time
- Today, 06:53
- Joined
- Dec 1, 2014
- Messages
- 404
Hi. I currentyl have an edit form in my database. I enter a batch no in a textbox and then click the edit command button and it loads all the data that im allowed to edit, makes comboxes eanbled etc.
This works great. I also have another form with a subform in it that is showing a summary of all data. WIthin the subform there is an edit button.
WHat i want this edit button to do is open my edit form, look in the subform and put the batch no in the batch no. text box of the edit form and simulate the clicking of the command button to populate all the data in the comboboxes etc.
I can manage to open the edit form from the subform and populate the batch no but I dont know how to call an event from another bit of code.
I considered just copying and pasting the command button codse into the on load event for the form but i dont want to trigger this event if I open the edit form the normal way rather than via the subform of another form. I could just create 2 edit forms and add the stuff to the on load event but this would make form maintenance messy if i want to add somethign to the edit form.
GUess im really looking for some help on how to call event from another form.
FOr clarity my actual forms are called:
Frm_BatchInput which has a subform in it called Frm_BatchINputSubForm
THe edit form is called Frm_BatchInputEdit and the command button i want to simulate clicking is called Cmd_EditPottingData_Click()
I found someting online that suggested the following:
BUt this fails when i run the code.
Any help on calling event would be massively appreciated.
This works great. I also have another form with a subform in it that is showing a summary of all data. WIthin the subform there is an edit button.
WHat i want this edit button to do is open my edit form, look in the subform and put the batch no in the batch no. text box of the edit form and simulate the clicking of the command button to populate all the data in the comboboxes etc.
I can manage to open the edit form from the subform and populate the batch no but I dont know how to call an event from another bit of code.
I considered just copying and pasting the command button codse into the on load event for the form but i dont want to trigger this event if I open the edit form the normal way rather than via the subform of another form. I could just create 2 edit forms and add the stuff to the on load event but this would make form maintenance messy if i want to add somethign to the edit form.
GUess im really looking for some help on how to call event from another form.
FOr clarity my actual forms are called:
Frm_BatchInput which has a subform in it called Frm_BatchINputSubForm
THe edit form is called Frm_BatchInputEdit and the command button i want to simulate clicking is called Cmd_EditPottingData_Click()
I found someting online that suggested the following:
Code:
Call YourButtonName_Click
BUt this fails when i run the code.
Any help on calling event would be massively appreciated.