legendv
03-27-2002, 04:23 PM
Need a little help here, if someone has the time. I have a form with a tabctl on it with 5 pages. On the first page (page index 0) is a checkbox. when the user clicks the checkbox and value is true I want the focus to be set to a textbox on a different page (page index 1). I tried:
chkbox OnClick event
if chkbox.value = true then
form_customer.tabctl14.page1.date.setfocus
else
othertxtbox.setfocus
endif
This doesn't work. Seems logical to me, but to no avail it doesn't. Any suggestions?
naygl
03-27-2002, 05:36 PM
Try
chkbox OnClick event
if chkbox.value = true then
form_customer!page1!Controls!date.setfocus
else
othertxtbox.setfocus
endif
Glen.
If Me.Checkbox=True Then
Page.1.SetFocus
date.SetFocus
Else
OtherTxtBox.SetFocus
End If
Also if you have a field named date then you should change it to something else, Date is a reserved word in access.
legendv
03-28-2002, 05:18 AM
naygl, and Rich,
Thanks for your help, tried both ways but neither would setfocus/go to the page.
when false, it did setfocus to other object, but the main objective was to open the other page.
Using page.1.setfocus gave me an unexpected compile error.
What am I doing wrong?
legendv
03-28-2002, 05:25 AM
Thanks fellows, got it to work with your help and looking at it a little closer. I was using the page index number instead of the objects name. Sorry about that. It works now this is what worked.
Private Sub MakeAppt_Click()
If MakeAppt.Value = True Then
Form_Customer.Page28.SetFocus
DateToday.SetFocus
Else
Walk_Phone.SetFocus
End If
End Sub