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

Macro action: RunSql

P: 24
Hi guys,

Currently in my DB I have a macro to run an Sql action, I am using the INSERT INTO function. Everything is working fine but I wanted to increase the number of fields that is being entered into the table. In Access the run sql action only accepts up to 256 characters.
I decided maybe it can be done by setting up 2 RunSql actions. The problem I am having is the second RunSql action is not entering the data on the same row as the first RunSql action. Is there anything I can do to make it insert all the fields in the same row. Hope this makes sense. Thanks again for any advice.
Dec 4 '06 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 159
You have two options:

You could use an event procedure instead of a macro. in the event procedure use the code
mySQL = "your insert into statement here"
docmd.runsql mySQL


you could create an append query in access and save it. and then in your macro use the open query command instead of the runsql.

either way will create identical results, so use which ever you are more comfortable with.
Dec 4 '06 #2

P: 24
Thank you MSeda, I was able to do it in the event procedure. Thank you very much.
Dec 4 '06 #3

Post your reply

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