BarryMK
4 strings are enough
- Local time
- Today, 23:05
- Joined
- Oct 15, 2002
- Messages
- 1,349
Hello Good People
I have this piece of code which opens a popup form from a command button on form 1. The standard link criteria bind the popup to the record showing on form 1 (field ID) is the PK. So far so good. Problem is that now when I move to a different record on form 1, the binding fails and the resulting popup is not related to the record. Am I missing a refresh, requery or similar here? Is the save record command wrongly placed perhaps?
Private Sub CmdOpenEffReview2_Click()
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.RunCommand acCmdSaveRecord
stDocName = "EffectivenessReview"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenEffReview2_Click:
Exit Sub
Err_OpenEffReview2_Click:
MsgBox Err.Description
Resume Exit_OpenEffReview2_Click
End Sub
I have this piece of code which opens a popup form from a command button on form 1. The standard link criteria bind the popup to the record showing on form 1 (field ID) is the PK. So far so good. Problem is that now when I move to a different record on form 1, the binding fails and the resulting popup is not related to the record. Am I missing a refresh, requery or similar here? Is the save record command wrongly placed perhaps?
Private Sub CmdOpenEffReview2_Click()
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.RunCommand acCmdSaveRecord
stDocName = "EffectivenessReview"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenEffReview2_Click:
Exit Sub
Err_OpenEffReview2_Click:
MsgBox Err.Description
Resume Exit_OpenEffReview2_Click
End Sub