Private Sub Command4_Click()
If IsNull(BeginDate.Value) Then
MsgBox ("Please enter the begin date.")
BeginDate.SetFocus
Exit Sub
ElseIf IsNull(EndDate.Value) Then
MsgBox ("Please enter the end date.")
EndDate.SetFocus
Exit Sub
ElseIf BeginDate.Value > EndDate.Value Then
MsgBox ("Begin Date occurs after end date, please revise.")
BeginDate.SetFocus
Exit Sub
ElseIf Len(BeginDate) <> 8 Then
MsgBox ("Begin Date must be following format: YYYYMMDD")
Exit Sub
ElseIf Len(EndDate) <> 8 Then
MsgBox ("End Date must be following format: YYYYMMDD")
Exit Sub
Else
Me.Visible = False
Dim strDate, EDate As Date
Dim x, y As String
x = Me.BeginDate.Value
y = Me.EndDate.Value
x = x + "010101"
y = y + "231212"
strDate = Get_Date_Time(x)
EDate = Get_Date_Time(y)
Me.Label6.Value = strDate
Me.Label7.Value = EndDate
DoCmd.SetWarnings (False)
DoCmd.OpenQuery "qry_Lost_Revenue"
DoCmd.SetWarnings (True)
Call Fix_Revenue_Temp_Table
End If
End Sub