Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I check field is not empty on Tab Control Page? 2

Status
Not open for further replies.

ffleitas

Technical User
Mar 15, 2001
85
US
Hello programmers,

I have a tab control page form and when I click on another tab page ex. page2 I would like to be able to check if a field on page1 is not null before activating page2 entry mode. How can I perform this function?

Thank you,
Felix
 
Try with onclick event of the tab control

Follow this example:

You have a tab ctrl with 2 pages called t1 and t2
In the first page you must put a txt ctrl named txt1

In the event onclick of t2 put this code

Private Sub t2_Click()
If IsNull(Me.txt1) Then
Me.t1.SetFocus
Me.txt1.SetFocus

End If
End Sub


Be careful because Access raises this event when you click the body of t2 (not when you click the label)
 
Actually you can set the focus to txt1 without having to set the focus to tab1 first. Using the me. allows you to access any control on your form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top