Not sure why this has stopped working,
I have a form which opens another form based on the options selcect from a dropdown box.
The form Loads but only loads a balnk form. Have checked then naming conventions for the feilds and control source and they are all correct.
Also having a problem with the checking and messaging if the record does not exist below is the code I am running
Private Sub Submit_Click()
If IsNull(Me.Log_Number) Or IsNull(Me.Type_of_Incident) = True Then
MsgBox "Feilds cannot be Left Blank"
Exit Sub
End If
DoCmd.OpenForm Me.Type_of_Incident, , , "[Log Number]= '" & Me.Log_Number & "'"
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "There are zero records in the data source!", vbInformation, "No Records Found"
DoCmd.Close acForm, Me.Name
End If
DoCmd.Close acForm, "continue report", acSaveNo
DoCmd.Close acForm, "Selection", acSaveNo
End Sub
Thank you
I have a form which opens another form based on the options selcect from a dropdown box.
The form Loads but only loads a balnk form. Have checked then naming conventions for the feilds and control source and they are all correct.
Also having a problem with the checking and messaging if the record does not exist below is the code I am running
Private Sub Submit_Click()
If IsNull(Me.Log_Number) Or IsNull(Me.Type_of_Incident) = True Then
MsgBox "Feilds cannot be Left Blank"
Exit Sub
End If
DoCmd.OpenForm Me.Type_of_Incident, , , "[Log Number]= '" & Me.Log_Number & "'"
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "There are zero records in the data source!", vbInformation, "No Records Found"
DoCmd.Close acForm, Me.Name
End If
DoCmd.Close acForm, "continue report", acSaveNo
DoCmd.Close acForm, "Selection", acSaveNo
End Sub
Thank you