I have created a form, and wanted to be able to click on a button to change a field in the form from the existing date to a past date automatically with a click. However, I keep receiving an error message stating the value basically doesn't make sense. Here is what I have for codes:
Private Sub Command15_Click()
If Forms!AddOrderEntry!ActionSpecify = "RENEWAL" Then
If MsgBox("Would you like to close this case?", vbQuestion + vbYesNo, "Confirm Closure?") = vbYes Then
Me.CloseDate = Date - 1
Me.Status.Visible = True
Me.Refresh
End If
Else
If Forms!AddOrderEntry!ActionSpecify = "DEACTIVATION" Then
If MsgBox("Would you like to close this case?", vbQuestion + vbYesNo, "Confirm Closure?") = vbYes Then
Me.CloseDate = Date
Me.Status.Visible = True
Me.Refresh
End If
End If
End Sub
I have already did numerous different ways, and none of them took. Datediff ("d"(date-1)) was one I tried. Can someone help me please????