Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Date-Field keeps displaying 12/30/1988

Status
Not open for further replies.

jjones100

Technical User
Nov 12, 2004
23
US
Having a problem with this code:
Mydate = VBA.Date
SQLUpdate = "UPDATE CustomerImports SET SentToBeKeyed =" & Mydate

Looks simply, but after I run this code the database table has the value of 12/30/1988 and then when i actual click inside the cell in the table it shows 12:00:07 AM. I have tried changing data to text and date & time but still will not hold correct current date. I know the mydate variable is correct. What is up with this? Thanks
 
Either:
SQLUpdate = "UPDATE CustomerImports SET SentToBeKeyed=#" & Mydate & "#"
or:
SQLUpdate = "UPDATE CustomerImports SET SentToBeKeyed=Date()"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top