Working with multiple forms

  • Thread starter Thread starter Fay Yocum
  • Start date Start date
F

Fay Yocum

I have several questions, but first the setup
Mainform = frmEmployees On the frmEmployees I have a tab control =
TabCtl36. On the tab control I have multiple forms on the tab control. Some
forms are a combination of 2-5 different subforms. I need to push
information around.

1. On subfrmEmail located as follows subfrmEmail is located on the tab "&1
Addresses" on the "TabCtl36" tab control located on the "frmEmployees"
mainform. I have a button in the subfrmEmails footer to add a new record. It
works correctly prior to adding to the mainform. I also want to set the
focus to EmailType. Here is my code

Private Sub cmdAdd_Click()
On Error GoTo Err_cmdAdd_Click


DoCmd.GoToRecord , , , acNewRec
Forms!frmEmployees.TabCtl36!subfrmEmail.Form!EmailType.SetFocus
Exit_cmdAdd_Click:
Exit Sub

Err_cmdAdd_Click:
MsgBox Err.Description
Resume Exit_cmdAdd_Click

End Sub

What am I missing?

How do I move information from second subform on a tab control page to a
another second or third level subfrm?

Thanks Fay
 
Fay,

A tab control is just a control. The code you have used makes it look
like a property of the form or some such, which it is not.

If I understand you correctly, your code should read...
DoCmd.GoToRecord , , , acNewRec
Me.EmailType.SetFocus
 
Back
Top