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

Access 2003 VBA SQL Insert Limitation

P: 2
I have a Query that I need to insert 58 columns of data. I built the query in VBA, but it will not work. Says it is missing a comma (,) so when i display what the Final Query looks like it is missing paramaters at the end. Is there a limitation on the size that a Query can be? Can there only be so many characters, including the column names, in a query?

How can I get around this?
Do I have to insert the data for half the form, and then get the last row inserted (which I do not know how to do) and then update the newly inserted row with the rest of the data from the form?

Thanks
CJ
Mar 13 '08 #1
Share this Question
Share on Google+
2 Replies


Expert Mod 2.5K+
P: 2,545
I have a Query that I need to insert 58 columns of data. I built the query in VBA, but it will not work. Says it is missing a comma (,) so when i display what the Final Query looks like it is missing paramaters at the end. Is there a limitation on the size that a Query can be? Can there only be so many characters, including the column names, in a query?

How can I get around this?
Do I have to insert the data for half the form, and then get the last row inserted (which I do not know how to do) and then update the newly inserted row with the rest of the data from the form?

Thanks
CJ
Hi. As a piece of general advice, if you have written some code and you get an error it is not Access that is the most likely cause - it is the code you've just written. I am absolutely certain there is an error in your code, and if you would like to post it in a reply the contributors to this forum will be able to advise you further on what should be changed to resolve your error.

-Stewart
Mar 13 '08 #2

P: 2
Hi. As a piece of general advice, if you have written some code and you get an error it is not Access that is the most likely cause - it is the code you've just written. I am absolutely certain there is an error in your code, and if you would like to post it in a reply the contributors to this forum will be able to advise you further on what should be changed to resolve your error.

-Stewart
To clarify, I did not write the code, I am fixing someone elses mess.

It is an access problem, there was no error in the code, Access (VBA) will only allow you to have so many characters in an insert Statement.

It is working now. I did an insert statement that inserted the primary information. Then I check to see what ID number of the row I just inserted is, pull it back and do an update statement to get the rest of the information into the database table for that record.

Thanks for your reply, it is working great now.
Mar 28 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.