sql INSERT INTO problem with using date() function
Posted on 2005-03-30
I am having a problem using an INSERT INTO statement with the date() and environ("username") function in vb.
TXT_DATE = DATE()
TXT_COM_MOD = Environ("username")
str_sql = _
"INSERT INTO Comments (ID, DATE, COM_MOD) VALUES (" & CMB_ID & "," & TXT_DATE & TXT_COM_MOD &")"
the ID is being pulled fine from a combo box
the DATE is being pulled from a text box on a form where the date is correct but when it is written to the table it is showing up as 12/30/1899 and when i click on the date in the table the date changes to a time showing 12:00:004 am
and when i deselect the field it returns to 12/30/1899
and when the sql statment runs it brings up an enter parameter value dialog box for input on the user id
If anyone knows what is causing these problems your help would be greatly appreciated