input new record to table

tubar

Registered User.
Local time
Today, 08:48
Joined
Jul 13, 2006
Messages
190
i tried this

Dim rec as Recordset
Set rec = CurrentDb.OpenRecordset("EVENT NUMBERS", dbopendynaset)
with rec
.addnew
!F1 = MCC
!F2 =-
.update
end with
set rec = nothing

but get this

Invalid SQL statement expected; ‘delete’, ‘insert’, ‘procedure’, ‘select’, ‘update’

can some one fix the above code...i build a macro and at the end i "run SQL" with the above code
 
Generally speaking I don't see anything wrong with that, though the values look odd. This is not something that could be done with RunSQL though; where exactly are you using it?
 
As Paul says, you can't use RunSQL with this. You don't need to use Runsql, the code you have already adds a new record to the table.
The code you have written to add a record to the table is not a query at all.
To make it clearer, just remove the RunSQL from the code or macro and see if that works for you.
 

Users who are viewing this thread

Back
Top Bottom