Method or Data member not found

G

Guest

Hello I have the following code:

strQcode = "INSERT INTO comments (memid, posted, postedby, subject,
type) " & _
"SELECT " & Me.memid & " AS Expr1, Format(Now(),'dd/mm/yy hh:nn
AM/PM') AS Expr2, '" & _
UserInitials & "' AS Expr3, '" & Me.examcode & " " & par & "
Exemption From " & _
Me.cboexamcode & " approved' AS Expr4, 'Comment' AS Expr5;"
CurrentDb.Execute strQcode
CurrentDb.Close

Memid is an Autonumber and the form is based on the table with that field.
There is also a text box bound to it and called memid on the form. When I try
to debug the code it flags that and says it cant find it. When I type Me
followed by a '.' it lists memid.

I have tried creating a new text box and binding it to it and changing the
code but it still comes up.

many thanks to anyone who can help.

James
 
D

David C. Holley

A control with that name must exist on the form. Also, the
CurrentDb.close should be deleted.
 

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