By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,736 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

Execute/Insert into method works sometimes??

P: n/a
I am having trouble with a line of code from a database currently in
progress. I swear it worked yesterday but today I get a "too few
parameters, 1 expected" error 3061 message. I have an unbound form with a
few user input boxes and after the last one is filled, it is supposed to add
the info to a table. Here is the line that bombs...what am I doing wrong?
If there is a better method, I would apreciate some guidance. During debug
the TxtID and TxtInOut shows the correct values within this line of code so
I am at a loss.

MyDB.Execute "INSERT into tblEntry (Empid, ClockInOut) values (" & Me!TxtID
& ", " & Me!TxtInOut & ")"

Thanks,
Mark


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Mark Valk wrote:
I am having trouble with a line of code from a database currently in
progress. I swear it worked yesterday but today I get a "too few
parameters, 1 expected" error 3061 message. I have an unbound form with a
few user input boxes and after the last one is filled, it is supposed to add
the info to a table. Here is the line that bombs...what am I doing wrong?
If there is a better method, I would apreciate some guidance. During debug
the TxtID and TxtInOut shows the correct values within this line of code so
I am at a loss.

MyDB.Execute "INSERT into tblEntry (Empid, ClockInOut) values (" & Me!TxtID
& ", " & Me!TxtInOut & ")"

I think it doesn't hurt to put (single) quotation marks around the
values in the VALUES clause. That is not standard SQL, especially for
numerical fields, but it may be it.

What values did you try to insert? Does anything change if you add
dbFailOnError (second parameter to Execute)
--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.