S
sue gray
I have a main form that has a command button to open a form in data entry
mode. The form I am opening has entry fields at the top of the form and 4
subforms - set up as pages in the middle.
My tables are tblclient, with clientid as primary key and autonumbered. and
tbltxplanmh with txplanMHID as primary key and autonumbered. clientid is a
foreign key in tbltxplanmh.
The problem I am having is when I click the command button the form opens in
entry mode and I can fill out the top entry fields, but the subforms (pages)
are blank boxes.
I have given as much info as I can think of, I hope I haven't confused
anyone too much. Thanks for any help. HEre's the command button code:
Private Sub AddTxPlan_MH_Click()
' This code adds a new tx plan based on client id.
On Error GoTo Err_AddTxPlan_MH_Click
Dim strDocName As String
strDocName = "frmTxPlanMH"
DoCmd.OpenForm strDocName, , , , acAdd, , Me!clientid
If IsNull(Forms!frmtxplanmh!clientid) Then
Forms!frmtxplanmh!clientid = Me!clientid
Forms!frmtxplanmh!ContactType.SetFocus
End If
Exit_AddTxPlan_MH_Click:
Exit Sub
Err_AddTxPlan_MH_Click:
MsgBox Err.Description
Resume Exit_AddTxPlan_MH_Click
End Sub
mode. The form I am opening has entry fields at the top of the form and 4
subforms - set up as pages in the middle.
My tables are tblclient, with clientid as primary key and autonumbered. and
tbltxplanmh with txplanMHID as primary key and autonumbered. clientid is a
foreign key in tbltxplanmh.
The problem I am having is when I click the command button the form opens in
entry mode and I can fill out the top entry fields, but the subforms (pages)
are blank boxes.
I have given as much info as I can think of, I hope I haven't confused
anyone too much. Thanks for any help. HEre's the command button code:
Private Sub AddTxPlan_MH_Click()
' This code adds a new tx plan based on client id.
On Error GoTo Err_AddTxPlan_MH_Click
Dim strDocName As String
strDocName = "frmTxPlanMH"
DoCmd.OpenForm strDocName, , , , acAdd, , Me!clientid
If IsNull(Forms!frmtxplanmh!clientid) Then
Forms!frmtxplanmh!clientid = Me!clientid
Forms!frmtxplanmh!ContactType.SetFocus
End If
Exit_AddTxPlan_MH_Click:
Exit Sub
Err_AddTxPlan_MH_Click:
MsgBox Err.Description
Resume Exit_AddTxPlan_MH_Click
End Sub