recordset error 3061

M

mark

I am running this code and am getting the error....
on line db.execute...
run-time error '3061'
too few parameters
expected 1.

Can someone tell me where the mistake is???

Private Sub Command46_Click()


Dim db As DAO.Database
Dim strsql As String

Set db = CurrentDb

With Me.RecordsetClone

..MoveFirst

Do Until .EOF

'begin of the insert statement to insert the records

strsql = _
"Insert into tblattendance " & _
"(StudentClockNum,programcode,coursenum,loginti
me,logouttime,exempt,shours) " & _
"Values (" & _
.Fields("StudentClockNum") & ", " & _
Me!Text22 & ", " & _
Me!Text24 & ", " & _
Format(Me!Login, "\#mm/dd/yyyy hh:nn:ss\#")
& ", " & _
Format(Me!logout, "\#mm/dd/yyyy hh:nn:ss\#")
& ", " & _
Me!Check60 & ", " & _
.Fields("thours") & _
");"

db.Execute strsql, dbFailOnError

..MoveNext
Loop
End With


Set db = Nothing

End Sub
 
V

Van T. Dinh

Bob & Mark???

I am sure the correct answer has been given but you got
numerous replies to your TOO NUMEROUS threads and you
can't work out which one too use.

Please learn how to use the newsgroup resources properly.
See
<http://www.mvps.org/access/netiquette.htm>

Van T. Dinh
MVP (Access)
 
B

Bob

Mark is my last name and I entered that by mistake. FYI,
the right ans has not been given.

Else I would not be wasting my time and others.
 
V

Van T. Dinh

Well ... you should post follow up question to the original thread and NEVER
post 2 or 3 threads in 3 or 4 newsgroups in a short time. I think I must
have seen about 7-8 threads from you on the same question posted in a short
time!

If you don't get any reply after a day or 2, only then you should post as a
new thread but also refer to the old thread.

I and a few other respondents have alluded to the fact that Text values MUST
be delimited by single or double quotes, just like you delimited the
date-time values in hashes (#). Unfortunately out of that many threads you
posted, there was only one post that you clearly specified that they were
Text values and hence most of respondents to your VARIOUS threads could only
guess what was the problem. I saw that post after I had replied to a later
post (with less info.) so I wrote again that Text values must be enclosed in
quotes - see the 2 threads you posted in the "Forms" newsgroup. I couldn't
be bother to detail the answer because I already answered the question
twice.

Had you spent time preparing a clear description of relevant details /
set-up and posting only ONE post (cross-posting to 2 or 3 relevant
newsgroups if you wish), and in this case, you can see all replies to your
post by checking just one of the newsgroups you posted to, you have less
threads to check, respondents can see all replies, can answer the question
more accurately and don't end up wasting time offering the same answers!

If you can't be bothered to read and observe a few rules to make the
newsgroup participation more efficient for everyone, then you should find
some alternative channels such as commercial consultancy services to get
help.

Put it another way: use the name "Bob Mark - Multi-Poster" and keep
multi-posting in these newsgroups and see how many replies you get from the
regular respondents. Most of these respondents read and answer a large
number of Access (and other) newsgroups so they get sick of wasting time
reading the SAME question from the same person!
 
B

bob

I regret the inconvenenince. No, I have not yet received
the right answer.

When my threads died I had to start a new one. Also my
design changed a bit.

You must also appreciate that I tried a lot of wrong
answers also and they were quite a few.

Not everytime on these groups you get the right ans.
 
D

Dirk Goldgar

bob said:
I regret the inconvenenince. No, I have not yet received
the right answer.

When my threads died I had to start a new one. Also my
design changed a bit.

You must also appreciate that I tried a lot of wrong
answers also and they were quite a few.

Not everytime on these groups you get the right ans.

Bob, you need to learn how these newsgroups work. None of your threads
"died". Every one I saw had at least one reply, and no followup reply
from you. If you don't post a reply indicating that an answer has not
solved your problem, then the odds of anyone coming along later and
posting a better answer in that thread are minimal. The ball is in your
court, to tell your respondent that the answer was wrong or inadequate.
If you fail to do so, you are being both rude and unhelpful in the
process of solving the problem you brought to the newsgroup.

And be patient. Newsgroups are not chat rooms; a response turnaround
time of several hours should be considered very good; a reponse time of
a day is fair.
 
V

Van T. Dinh

OK. You got the error because you did not enclose Text values in quotes.
Let me count the number of responses that the respondents did mention that
explicit Text values must be enclosed in quotes for you (in no particular
order):

1. Scott McDaniel in the thread "error on recordset" in the newsgroup
"microsoft.public.access"

2. Michel Walsh in the thread "multifield recordset error" in the newsgroup
"microsoft.public.access.forms"

3. I myself in the thread "recordset error 3061" in the newsgroup
"microsoft.public.access.forms"

4. I myself in the thread "unbound field reordset error" (your spelling) in
the newsgroup "microsoft.public.access.forms"

5. Marshall Barton in the thread "unbound field recordset error" in the
newsgroup "microsoft.public.access.formscoding"

6. Tina in the thread "insert query error" in the newsgroup
"microsoft.public.access.modulesdaovba"

7. Tim Ferguson in the thread "error on recordset code" in the newsgroup
"microsoft.public.access.modulesdaovba"

8. Dirk Golgar in the thread "multi field recordset insert error" in the
newsgroup "microsoft.public.access.modulesdaovba"

9. Scott McDaniel in the thread "unbound fields recordset error" in the
newsgroup "microsoft.public.access.modulesdaovba"

10. I myself again earlier in this thread.

despite the fact that you mentioned Text values only once in various
threads. If you don't understand what the respondents meant, you should ask
for clarification and sample code. Instead you simply IGNORED and posted
new threads!

I note that a number of respondents also mentioned that you should use
MessageBox or Debug.Print to see what was being passed to the JET database
engine for processing and it seemed to me you also IGNORED this advice.

WORST, I noted that you have been advised not to multi-post and to create
multiple threads on the same question by myself, TC, Michel Walsh at least
since 02/Dec/2003 and you also IGNORED this advice.

Are you the same Bob who insisted that it was his rights to multi-post if he
liked a few months back?

If you DON'T want to follow the advices given, why would you bother to ask
in the first place?
 
V

Van T. Dinh

(Addendum)

I left out in my list:

11. John Spencer (MVP) in the thread "multifields recordset error" in the
newsgroup "microsoft.public.access.modulesdaovba".

There may be more that I haven't picked up.

No correct ans??? I think it is more like no proper application of the
correct answers and no follow-ups ...

Or may be too many answers and you got confused by the info. overload???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top