theKruser
Registered User.
- Local time
- Today, 03:14
- Joined
- Aug 6, 2008
- Messages
- 122
Bottom line: Any idea how to handle the "IsNull" process?
I have a form in which the user is to input 5 dates. Three of the 5 dates must occur in sequence, meaning date one MUST come before date two, which MUST come before date three. I am building what is in essence a date sequence checker to identify data entry errors and prevent future problems. The issue is that only two of the 5 dates are required, meaning the other three will more often than not be blank. I need a way for the checker to "skip over" the dates left blank if the user does not have that information at the time of entry. With the sequence checker, I am building a message box that will identify the errors and tell the user what they did wrong at the end. Here is a snippet of what I am building. The first Select Case statement is the last of 5 (the first 4 are omitted for ease of reading, but function the same).
Any idea how to handle the "IsNull" process?
Thank you in advance for your time and help!
I have a form in which the user is to input 5 dates. Three of the 5 dates must occur in sequence, meaning date one MUST come before date two, which MUST come before date three. I am building what is in essence a date sequence checker to identify data entry errors and prevent future problems. The issue is that only two of the 5 dates are required, meaning the other three will more often than not be blank. I need a way for the checker to "skip over" the dates left blank if the user does not have that information at the time of entry. With the sequence checker, I am building a message box that will identify the errors and tell the user what they did wrong at the end. Here is a snippet of what I am building. The first Select Case statement is the last of 5 (the first 4 are omitted for ease of reading, but function the same).
Any idea how to handle the "IsNull" process?
Thank you in advance for your time and help!
Code:
Select Case Me.sdtEnd
Case IsNull
End Select
Case Is < Me.sdtPtp
msg = msg & "End date cannot be before P date." & vbNewLine
i = i + 1
Case Is > Me.sdtCut
msg = msg & "End date cannot be before cutoff date." & vbNewLine
i = i + 1
Case Is < Me.sdtCho
msg = msg & "End date cannot be before C date." & vbNewLine
i = i + 1
Case Is < Me.sdtBeg
msg = msg & "End date cannot be before begin date." & vbNewLine
i = i + 1
End Select
Select Case i
Case 0
Me.Dirty = False
DoCmd.GoToRecord , , acNewRec
Case 1
msg = "You have entered conflicting dates. " & msg
GoTo EntryError
Case Is > 1
msg = "You have entered conflicting dates. See below list:" & vbNewLine & vbNewLine & msg
GoTo EntryError
Case Else
msg = "There has been an undefined error. Please move this message box aside and send an unimpeded screen capture of the form you were working on to the application developer."
End Select