G
Guest
I have created 2 forms. One I call subfrmSerialNumber, which is a Summary
form, the other frmRepair, is a detail. I use a query to feed the forms. I
have a cmd button on Summary, tied to the click event, that opens the detail
to the same data(record). The used the wizard to creat this
I can't write to the Detail. I found that if I close the frmSummary, it
works. I would have thought the Wizard would have taken this into
consideration. I tried to close the frmSummary by adding a Docmd.Close to
the code used in that event. I get a error saying it cant find object???
(Maybe it thinks its closed already)
I can also get it to work by setting no locks on fthe detail, but that
doesnt work well in this environment.
Private Sub cmdOpensubfrmSNCheck_Click()
On Error GoTo Err_cmdOpensubfrmSNCheck_Click
DoCmd.Close
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmRepair"
stLinkCriteria = "[RMA]=" & "'" & Me![RMA] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpensubfrmSNCheck_Click:
Exit Sub
Err_cmdOpensubfrmSNCheck_Click:
MsgBox Err.Description
Resume Exit_cmdOpensubfrmSNCheck_Click
End Sub
I hope this makes sense.
form, the other frmRepair, is a detail. I use a query to feed the forms. I
have a cmd button on Summary, tied to the click event, that opens the detail
to the same data(record). The used the wizard to creat this
I can't write to the Detail. I found that if I close the frmSummary, it
works. I would have thought the Wizard would have taken this into
consideration. I tried to close the frmSummary by adding a Docmd.Close to
the code used in that event. I get a error saying it cant find object???
(Maybe it thinks its closed already)
I can also get it to work by setting no locks on fthe detail, but that
doesnt work well in this environment.
Private Sub cmdOpensubfrmSNCheck_Click()
On Error GoTo Err_cmdOpensubfrmSNCheck_Click
DoCmd.Close
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmRepair"
stLinkCriteria = "[RMA]=" & "'" & Me![RMA] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpensubfrmSNCheck_Click:
Exit Sub
Err_cmdOpensubfrmSNCheck_Click:
MsgBox Err.Description
Resume Exit_cmdOpensubfrmSNCheck_Click
End Sub
I hope this makes sense.