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

GotoControl with Subform on 4 tab of tab control

Status
Not open for further replies.

suchasynic

Technical User
Feb 11, 2003
91
0
0
Hi,

I'm having issues with DoCmd.GotoControl

I have a form called Contacts
This form has a tab control on it with 4 tabs (pgeGeneral, pgeShippingAddress,pgeAffilliations,pgeCallNotes)

On pgeCallNotes, I have a subform. The control source is a query to table called "call" -- contactID = Forms!Contacts!ContactID. The Subform (Call Notes Subform) has several controls -- call date, call time, call notes,....

On the pgeCallNotes Tab Control, I also have a cmd button to add a record to the call table (btnAddCallNote)

When I click on my pgeCallNotes tab control the control call date on the Call Notes Subform is always the focus.

I added the follwing code to the pgeCallNotes Click event:

DoCmd.GotoControl "btnAddCallNote"


This doesn't seem to work -- if I add this code to the Call Notes Subform Load Event -- then when opening the main form I go to the pgeCallNotes tab right away & I don't want that.

I've tried many things -- I did have it working at one point, but then I had issues when I would click on a different tab control on the main form and go back to the pgeCallNotes tab control -- the selected control is not btnAddCallNote like I want.

I'm spinning my wheels -- any help is much appreciated :)



 
Private Sub TabCtl0_Change()
If TabCtl0.Pages(TabCtl0.Value).Name = "pgeCallNotes" Then
Me.btnAddCallNote.SetFocus
End If
End Sub

Your post is very long winded, but I think you want to go to the "btnAddCallNote" when you click on "pgeCallNotes".
 
Thanks -- but I have had no success with this.
 
What does or does not happen? The code is correct, if I understood what you wanted to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top