Use "Gotopage" in subform

le888

Registered User.
Local time
Yesterday, 23:29
Joined
Dec 10, 2003
Messages
344
Hi,

How to use "gotopage" in a subform? I have a main form and a subform. I want to click on a field "txtAbstractName" on the subform and it brings me to a second page of the main form. I have try :

Code:
Private Sub txtAbstractName_Click()
  me.parent.gotopage 2 ' txtAbstractName is in the subform
End Sub



This brings me an error message. Any ideas?

Thanks,

Le
 
By using the Pages property you can use two methods: -

Me.Parent.ctlMyTabControl.Pages(1).SetFocus

or

Me.Parent.ctlMyTabControl.Pages("Fred").SetFocus

You will need to change the names of the tab control and page to suit your needs.

Correction on the above:
I read it as the Page on a Tab control on the parent form and after reading it again I guess it’s not.

Edit again:
Looks like you will need to setfocus to a control on the parent form before using the GoTo Page method for the parent.


Regards,
Chris.
 
Last edited:
Thanks. It works with the correction.

Le
 

Users who are viewing this thread

Back
Top Bottom