According to this code, I assume it's opening a form and linking the 'dateIncidents'. I want it to link another field as well. How do I modify it correctly?
What I basically want to do is:
1) Click Add Record
2) It opens a new form that displays a bunch of new info to enter...which is related to the SAME record. To relate it, I need to link two fields. 'dateIncident' and 'companyName'.
What I basically want to do is:
1) Click Add Record
2) It opens a new form that displays a bunch of new info to enter...which is related to the SAME record. To relate it, I need to link two fields. 'dateIncident' and 'companyName'.
Code:
Private Sub Add_Click()
Dim stDocName As String
Dim stLinkCriteria1 As String
Select Case Me.incidentResolvedYN
Case False
'--DoCmd.OpenForm "frm_addIncidentReport_page1"
stDocName = "frm_addIncidentReport_page1"
stLinkCriteria = "[dateIncident]=" & Me![dateIncident]
DoCmd.OpenForm stDocName, , , stLinkCriteria1
Case Else
'--Do nothing
End Select
On Error GoTo Err_Add_Click
DoCmd.GoToRecord , , acNewRec
Exit_Add_Click:
Exit Sub
Err_Add_Click:
MsgBox Err.Description
Resume Exit_Add_Click
End Sub