Hello.
In Access 2013, I have a control on one form that has 2 tabs. On another form, I have an option group with 2 options. I am trying to write it in VBA so that I select an option, click a button and based on the selection, the other form opens to the designated tab on the control.
Here is what I have on the Click event of the button:
(I build some tables upon opening the other form)
The form opens but not to the corresponding page and I am getting "Object required"
Thanks.
In Access 2013, I have a control on one form that has 2 tabs. On another form, I have an option group with 2 options. I am trying to write it in VBA so that I select an option, click a button and based on the selection, the other form opens to the designated tab on the control.
Here is what I have on the Click event of the button:
(I build some tables upon opening the other form)
Code:
Private Sub cmdclose_Click()
On Error GoTo cmdclose_Click_Err
DoCmd.OpenQuery "appq_cct_date", acViewNormal
DoCmd.OpenQuery "appq_cust_date", acViewNormal
DoCmd.OpenQuery "appq_customer", acViewNormal
DoCmd.OpenQuery "appq_cct", acViewNormal
If frmetype = "1" Then
DoCmd.OpenForm "frm_sec_menu", acNormal
TabCtlSEC.Pages(0).SetFocus
ElseIf frmetype = "2" Then
DoCmd.OpenForm "frm_sec_menu", acNormal
TabCtlSEC.Pages(1).SetFocus
End If
cmdclose_Click_Exit:
Exit Sub
cmdclose_Click_Err:
MsgBox Error$
Resume cmdclose_Click_Exit
End Sub
Thanks.
Comment