Good Morning
Have the following code and is all working but I need to add an additional section to the where clause but cannot get it to work I need to add to both dcounts [log Number] = me![Log Number] any ideas
Thank you
Have the following code and is all working but I need to add an additional section to the where clause but cannot get it to work I need to add to both dcounts [log Number] = me![Log Number] any ideas
Code:
Private Sub Submit_Click()
If IsNull(Me.Serial_Number) = True Or IsNull(Me.Log_Number) Or IsNull(Me.Type_of_Incident) = True Then
MsgBox "Feilds cannot be Left Blank"
Exit Sub
End If
If DCount("*", Me![type of incident], "[serial number] = """ & Me![serial Number] & """") = 1 Then GoTo openform
If DCount("*", Me![type of incident], "[serial Number] = """ & Me![serial Number] & """") = 0 Then GoTo Error1
Error1:
MsgBox "Incident does not exist Please check you inputted Data and try again", , "Report Does Not Exist"
Exit Sub
openform:
DoCmd.openform Me.Type_of_Incident, , , "[Serial Number]='" & Me![serial Number] & "' and [Log Number]='" & Me![log Number] & "'"
DoCmd.Close acForm, "continue report", acSaveNo
DoCmd.Close acForm, "Selection", acSaveNo
End Sub
Comment