Inserting Date into table help

T

tiger

Hi,

I have a field in my table called DDate of type short date. When I try to
insert it into a table using the query below...I get an error messages like

- Data type mismatch in criteria expression
- Invalid use of Null

..CommandText = "INSERT INTO tblTime (DDate) VALUES ('"& Format
(txtDate1,"\#mm\/dd\/yyyy\#")&"')"

txtDate1 is a textbox name where the date is entered.

Thanks
Tiger
 
R

Rainbow01

from Rainbow01 Hong Kong

no need to type # when using Format function
i.e. Format(txtDate1,"mm/dd/yyyy")

"tiger" 來函:
 
A

Allen Browne

This information is incorrect.

The # delimiter will assist in ensuring the date is interpreted correctly,
regardless of the regional setting.

The quote delimiter should be omitted.
 
Top