M
mattc66 via AccessMonster.com
When the below code opens a new form I want it to pass the Me.CUSTOMER_NUM =
stCustId. When the new form is open the Customer_num field is blank.
Private Sub cmdNote_Click()
On Error GoTo Err_cmdNote_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stCustId As String
stDocName = "frmNotes"
stCustId = Me.CUSTOMER_NUM
If [NotesID] >= 1 Then
stLinkCriteria = "[NotesID]=" & Me![NotesID]
'stLink = "[GroupID]=" & Me![GroupID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
DoCmd.OpenForm stDocName, , , , acFormAdd
Me.CUSTOMER_NUM = stCustId
'DoCmd.OpenForm stDocName
End If
Exit_cmdNote_Click:
Exit Sub
Err_cmdNote_Click:
msgbox Err.Description
Resume Exit_cmdNote_Click
End Sub
stCustId. When the new form is open the Customer_num field is blank.
Private Sub cmdNote_Click()
On Error GoTo Err_cmdNote_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stCustId As String
stDocName = "frmNotes"
stCustId = Me.CUSTOMER_NUM
If [NotesID] >= 1 Then
stLinkCriteria = "[NotesID]=" & Me![NotesID]
'stLink = "[GroupID]=" & Me![GroupID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
DoCmd.OpenForm stDocName, , , , acFormAdd
Me.CUSTOMER_NUM = stCustId
'DoCmd.OpenForm stDocName
End If
Exit_cmdNote_Click:
Exit Sub
Err_cmdNote_Click:
msgbox Err.Description
Resume Exit_cmdNote_Click
End Sub