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

INSERT INTO Error

P: n/a
I have a form that a person enters some information on. They then clicka
button that triggers VBA to perfom a SQL INSERT INTO query.

One of the fields auto assignes the current date. Another field pulls
the users name from an api function. On the form both fields display
correctly.

The INSERT INTO statment goes as sfollows:

INSERT INTO tblServiceOrders ( All the fields are here) VALUES (#" &
Me.Text57 & "#, etc...

When I Open the form and enter the information then click the button I
receive the following error:

Compile Error
Method or date member not found

I have checked the spelling 4 times and even removed the control on the
form and created a new one.

The table that the data is to be inserted into has an is field that is
autonumber and assigned key field.

I have read information that says both I need to append a value and I do
not need to append a value to this field.

Can anyone tell me what I am missing? I have done many other SQL Insert
Into queries and have not had this problem before.

Thanks in advance!

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
If you want help with a coding problem you have to post the actual code,
not your understanding of your code.

You do not have to post a value to an autonumber field.

Also check your references and make sure they are all ok.

Regards

Peter Russell



Nothing previously wrote:
I have a form that a person enters some information on. They then clicka
button that triggers VBA to perfom a SQL INSERT INTO query.

One of the fields auto assignes the current date. Another field pulls
the users name from an api function. On the form both fields display
correctly.

The INSERT INTO statment goes as sfollows:

INSERT INTO tblServiceOrders ( All the fields are here) VALUES (#" &
Me.Text57 & "#, etc...

When I Open the form and enter the information then click the button I
receive the following error:

Compile Error
Method or date member not found

I have checked the spelling 4 times and even removed the control on the
form and created a new one.

The table that the data is to be inserted into has an is field that is
autonumber and assigned key field.

I have read information that says both I need to append a value and I do
not need to append a value to this field.

Can anyone tell me what I am missing? I have done many other SQL Insert
Into queries and have not had this problem before.

Thanks in advance!

Michael Charney

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 12 '05 #2

P: n/a
Michael,

how about posting the SQL statement? I'm wondering if you're using a
reserved word as a variable or something... are your values properly
delimited?
# for dates
' for text

what if you did something like

strValue = Replace(strValue,"'","''") so that you don't get caught by
something stupid like

"This isn't working" throwing off your text delimiting...

Sorry, I'm kinda going after the usual suspects, but no option, since
no SQL statement to check...
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.