S
sue gray
I have a main form (frmTxPlanHxMH) that opens a subform (frmTxPlanMH) from a
command button. frmTxPlanMH contains 5 subforms laid out in pages. My
problem is that when I open frmTxPlanMH none of the 5 subforms are there. I
see the tabnames but not the fields on the forms. But when I close
frmTxPlanMH and then open it from another command button to open it in read
only the forms show up.
Here's the code for both buttons. Thanks for any help. IT's greatly
appreciated.
tbltxplanmh - txplanmhid - pk
tblclient - clientid - pk
clientid - clientid one to many relationship
Private Sub AddTxPlan_MH_Click()
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
End If
Exit_AddTxPlan_MH_Click:
Exit Sub
Err_AddTxPlan_MH_Click:
MsgBox Err.Description
Resume Exit_AddTxPlan_MH_Click
End Sub
Private Sub View_TxPlan_MH_Click()
On Error GoTo Err_View_TxPlan_MH_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmTxPlanMh"
stLinkCriteria = "[txplanMHid]=" & Me![txplanMHID]
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly
Exit_View_TxPlan_MH_Click:
Exit Sub
Err_View_TxPlan_MH_Click:
MsgBox Err.Description
Resume Exit_View_TxPlan_MH_Click
End Sub
command button. frmTxPlanMH contains 5 subforms laid out in pages. My
problem is that when I open frmTxPlanMH none of the 5 subforms are there. I
see the tabnames but not the fields on the forms. But when I close
frmTxPlanMH and then open it from another command button to open it in read
only the forms show up.
Here's the code for both buttons. Thanks for any help. IT's greatly
appreciated.
tbltxplanmh - txplanmhid - pk
tblclient - clientid - pk
clientid - clientid one to many relationship
Private Sub AddTxPlan_MH_Click()
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
End If
Exit_AddTxPlan_MH_Click:
Exit Sub
Err_AddTxPlan_MH_Click:
MsgBox Err.Description
Resume Exit_AddTxPlan_MH_Click
End Sub
Private Sub View_TxPlan_MH_Click()
On Error GoTo Err_View_TxPlan_MH_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmTxPlanMh"
stLinkCriteria = "[txplanMHid]=" & Me![txplanMHID]
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormReadOnly
Exit_View_TxPlan_MH_Click:
Exit Sub
Err_View_TxPlan_MH_Click:
MsgBox Err.Description
Resume Exit_View_TxPlan_MH_Click
End Sub