Subform button help.

PuddinPie

Registered User.
Local time
Today, 08:33
Joined
Sep 15, 2010
Messages
149
I have been looking arround and can't seem to find an issue so I've come here to ask.

I have a main form and a sub form. I would like an onclick on the main form and acctivates and onclick on the subform. i.e. When someone clicks on the submit button in the main form it, in turn, clicks the submit button on the subform.

I tryed this:
Me![cmdSubmitChanges].SetFocus
and this:
Forms![frmFollow]![fsubTTDetails] = Form!cmdSubmitChanges_Click()

But they both say they are looking for a field that they can't find.

Thank you in advance.
 
You need to take the code from each of the buttons and put them into sub routines, i.e SubRoutineMainForm, SubRoutineSubForm, then you call both of these from the main form, but just SubRoutineSubForm on the subforms button.
 
I'm not quite sure what you meen by "sub routine". Are you talking about the event behind the procedure or something else?
 
Yes, so the event on the main set up like

Private Sub MainButtonCode()
 
Yes, so the event on the main set up like

Private Sub MainButtonCode()
YOUR CODE
End Sub

Private Sub SubButtonCode()YOUR CODE
End Sub

Then your events on the buttons are simply, main form
MainButtonCode
SubButtonCode

and the sub

SubButtonCode
 
Thats another issue. I can't have it run as a macro or module, otherwise it would be fine. The button in the main form only purpose is to call the button in the sub form and without the use of a module or macro. Do you know how to do this?
 
...The button in the main form only purpose is to call the button in the sub form and without the use of a module or macro.
This sounds suspiciously like a class work assignment! What exactly is the purpose of the 'submit' button in the subform? Is the subform bound?

Linq ;0)>
 
It is not class work. That would have been 10 years ago. (now I feel old). Instead of having to scroll down or up in the sub form to find the submit button I just was told to move it to the main form. I don't know why but thats what higher up's want.
The submit button does a recordset update for the sub form.
 

Users who are viewing this thread

Back
Top Bottom