I have a command button that closes the user input form and returns back to the navigation form. My current code is as follows:
However, I want to first check whether the user input any data at all into the form. If they don't, I just want to close the form without saving the record. The way the code is written right now, if they just open the form and click the button, a record is saved with all data just being completely blank.
Code:
If IsNewRecord = "Yes" Then
AssessmentEndTime.Value = Time
IsNewRecord = "No"
DoCmd.RunCommand acCmdSaveRecord
Else
End If
If MsgBox("Would you like to save and close the current assessment?", vbYesNo + vbQuestion) = vbYes Then
DoCmd.Close
DoCmd.OpenForm "Navigation"
Else
End If
However, I want to first check whether the user input any data at all into the form. If they don't, I just want to close the form without saving the record. The way the code is written right now, if they just open the form and click the button, a record is saved with all data just being completely blank.