synchronizing forms using wizard

B

Barth Wilsey

I am trying to work on the same record when switching to a new form using
the code below
The [MedRec] field is being transferred but when I leave the second form, a
dialog box appears telling me that I cannot save the record because if would
cause duplicate entries in the key field [MedRec]. Believing that the
problem is that the second form is going to a new record, I have tried to
set the AllowAdditions method off. When I do this, the second form appears
blank. Any help would be appreciated. Thanks in advance


Private Sub cmdOpenListOpioids_Click()
On Error GoTo Err_cmdOpenListOpioids_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAge"
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
stLinkCriteria = "[MedRec]=" & "'" & Me![txtMedRec] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenListOpioids_Click:
Exit Sub

Err_cmdOpenListOpioids_Click:
MsgBox Err.Description
Resume Exit_cmdOpenListOpioids_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top