C
CWH via AccessMonster.com
I was wondering if someone can look over the code below. My main form has a
control command (buttom) for a subform. I am trying to have the control
dispaly the message below if three fields are left blank (TeamName, Incident#,
Incident_Date). If data is entered then I would like the subform (Coordinate
Index - Incident) to open and filter just those records that have the same
incident# as the main form.
Any help would be appreicated.
..............................................................................
...........
Private Sub Command99_Click()
If Me.TeamName = False Then
If Me.Incident_ = False Then
If Me.Incident_Date = False Then
MsgBox "Enter Required Fields (Team Name, Incident#, Date) and try again.
", 48, "Data Warning..."
Exit Sub
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Forms!Coordinate Index - Incident"
stLinkCriteria = "[Incident #]=" & "'" & Me![Incident#] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End If
End If
End Sub
control command (buttom) for a subform. I am trying to have the control
dispaly the message below if three fields are left blank (TeamName, Incident#,
Incident_Date). If data is entered then I would like the subform (Coordinate
Index - Incident) to open and filter just those records that have the same
incident# as the main form.
Any help would be appreicated.
..............................................................................
...........
Private Sub Command99_Click()
If Me.TeamName = False Then
If Me.Incident_ = False Then
If Me.Incident_Date = False Then
MsgBox "Enter Required Fields (Team Name, Incident#, Date) and try again.
", 48, "Data Warning..."
Exit Sub
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Forms!Coordinate Index - Incident"
stLinkCriteria = "[Incident #]=" & "'" & Me![Incident#] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End If
End If
End Sub