INSERT code not working

krc777

Registered User.
Local time
Today, 14:18
Joined
Nov 29, 2005
Messages
70
Hello-
I've tried everything I can think of to get this code to run.

currrentdb.Execute "INSERT into MainRptDataASD (PlanName) VALUES ('Test')"

I've tried ' "& test &" " too. Test and PlanName are both string fields.


It works fine in the SQL app and inserts a record but I can't get it to work inside Access code.

k
 
do you get an error message? depending on your version of access you may need to set a reference to DAO.
In any module Tools>references...

Peter
 
well two errors, you need to keep the spacing between the variable, string, and the ampersand

" & test & " --- if test is a textbox on the form

but the real error is in your function call, you have too many "r"s

CurrentDb, not CurrrentDb
 
Last edited:
I looked at it so long I couldn't see it.
Thanks so much!
k
 

Users who are viewing this thread

Back
Top Bottom