error 3061 trying to insert a date in a table

Joined
Mar 21, 2011
Messages
3
Reaction score
0
Hello,

I´m trying to insert a into a table a date. The key is autonumeric so we don´t need to introduce a value in it and the table only has another value that is the date.

here you have the code:

Dim fecha_act As Date
Dim ult_fecha As Recordset
Dim dbs As Database

Set dbs = CurrentDb
fecha_act = Now()
dbs.Execute "INSERT into Fecha (fecha) values (fecha_act)"

I also tryed chanching the last line:

dbs.Execute "INSERT into Fecha (fecha) values (&fecha_act&)"

It give me another error (3075)

another attemp:

dbs.Execute "INSERT into Fecha (fecha) values ("&fecha_act&")"

It don´t let me even compile... Syntax error

Anyone know how to fix it?

Thanks for your help!
 
Back
Top