I am trying to update a field based on an input from the user. I get the date but the update sql will not accept the 'strdate' as a value. The basic process is to check to see if the date entered is a valid date and if so update the Activity_Date field withe that date. Is there someting else I need to do? <br>
<br>
Function CheckDate()<br>
Dim strdate As Date<br>
strdate = InputBox("Enter date as 1/1/99 for this Report"<br>
' Test variable.<br>
<br>
If IsDate(strdate) Then<br>
' If string is date, format and display in dialog.<br>
<br>
DoCmd.RunSQL "UPDATE Last_Update SET Activity_Date = 'strDate';"<br>
<br>
Else<br>
MsgBox "The value you entered is not a valid date."<br>
End If<br>
End Function<br>
<br>
Thanks<br>
<br>
Function CheckDate()<br>
Dim strdate As Date<br>
strdate = InputBox("Enter date as 1/1/99 for this Report"<br>
' Test variable.<br>
<br>
If IsDate(strdate) Then<br>
' If string is date, format and display in dialog.<br>
<br>
DoCmd.RunSQL "UPDATE Last_Update SET Activity_Date = 'strDate';"<br>
<br>
Else<br>
MsgBox "The value you entered is not a valid date."<br>
End If<br>
End Function<br>
<br>
Thanks<br>