Date Field Problems

redBo

New member
Local time
Today, 14:03
Joined
Jan 16, 2007
Messages
9
Hello All!

I am running Access 2003. Time format is set to Australian standards (ie dd/mm/yyyy). I have a field in my table whose property is set to Medium Date. Similarly a textbox in form, property set to Medium Date.

Im saving the form value to the table using the following technique:
strSQL = "INSERT INTO table(inDate) VALUES (" & Me.txtbox_inDate & ")"
docmd.runSQL strSQL

problem, however, is that regardless of the date I enter into the textbox, the table always shows 30-Dec-1899. On closer inspections I can see that the time changes. for example, entries of 1/1/07, 2/1/07, and 10/1/07 result in 30-Dec-1899 12.00.43AM, 12.01.26AM, and 12.07.10AM respectively....

What on earth am I doing wrong?
 
Try:

strSQL = "INSERT INTO table(inDate) VALUES (#" & Me.txtbox_inDate & "#)"
 
Thanks, works like a charm....
 

Users who are viewing this thread

Back
Top Bottom