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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you go to a certain tab (page) in a tab control

Status
Not open for further replies.

mystuff

Programmer
Apr 30, 2004
86
US
Hi,

I am using Access97 and I have a form with a tab control. In vba I am validating fields and if a field is not valid, I want control to go back to that tab (page) but I cannot get it to work.

What is the easies way to do this?

Thanks.

 
Where you are using the validation have code that goes back to the tabctl similar to:
If IsLoaded("frmClient") Then
Me.lstClients = forms!frmClient!txtID
Me.TabCtl51.Value = 2
ElseIf IsLoaded("frmSearcher") Then
Me.lstClients = forms!frmSearcher!lstAddress
Me.TabCtl51.Value = 0
Me.cmdOrder.Enabled = True
Me.cmdQuote.Enabled = True
Me.cmdService.Enabled = False
DoCmd.close acForm, "frmSearcher"
Else
Exit Sub
End If
This is from an actual app and sets up the form the way I want it on entry...

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
Hi

You could just set focus to the offending control, eg

TxtBoxInError.setfocus

where TxtBoxInError is the name of the control,

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top