I am trying to populate a field in one form based on a field from a previous form. In other words, a specific record has a unique identifier in a text box on form one (an autonumber). When the user presses "Continue," that same number should populate the identifier text box of the following form (a number--not autonumber). However, when the user presses continue, the id does not pass from the first form to the second. The following displays how my code is set up...What can I do?
Private Sub Continue_Click()
On Error GoTo Err_Continue_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "nextform"
stLinkCriteria = "[identifier]=" & Me![identifier]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Continue_Click:
Exit Sub
Err_Continue_Click:
MsgBox Err.Description
Resume Exit_Continue_Click
End Sub
Private Sub Continue_Click()
On Error GoTo Err_Continue_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "nextform"
stLinkCriteria = "[identifier]=" & Me![identifier]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Continue_Click:
Exit Sub
Err_Continue_Click:
MsgBox Err.Description
Resume Exit_Continue_Click
End Sub