Hi There could someone please point me in the right direction please, as I am stick again !!
I have an MDI application and each child form has a print button on it - always called cmdprint.
What I wish to do is have a menu option on the parent form called print and clicking on this calls the cmdprint button click event of the currently active child form, to print out a picture that is on the form.
I know how to get the active child form name and I know that I can loop down the controls collection to get a reference to the cmdprint button control, but what I can not figure out os how to actually call the click event of the control.
I have this so far :-
If Me.MdiChildren.Length > 0 Then
MsgBox(Me.ActiveMdiChild.Name)
For Each clscontrol In Me.ActiveMdiChild.Controls
If UCase(clscontrol.Name) = "CMDPRINT" Then
clsconret = clscontrol
End If
Next
End If
This obviously gives me a reference to the cmdprint control on the active MDI child form, but I now want to actually call the event click handler for the control, which is where the logic to print the pciture is located.
Any help,as always, would be greatly appreciated.
I have an MDI application and each child form has a print button on it - always called cmdprint.
What I wish to do is have a menu option on the parent form called print and clicking on this calls the cmdprint button click event of the currently active child form, to print out a picture that is on the form.
I know how to get the active child form name and I know that I can loop down the controls collection to get a reference to the cmdprint button control, but what I can not figure out os how to actually call the click event of the control.
I have this so far :-
If Me.MdiChildren.Length > 0 Then
MsgBox(Me.ActiveMdiChild.Name)
For Each clscontrol In Me.ActiveMdiChild.Controls
If UCase(clscontrol.Name) = "CMDPRINT" Then
clsconret = clscontrol
End If
Next
End If
This obviously gives me a reference to the cmdprint control on the active MDI child form, but I now want to actually call the event click handler for the control, which is where the logic to print the pciture is located.
Any help,as always, would be greatly appreciated.