Macro action: RunSql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Umoja
    New Member
    • Nov 2006
    • 24

    #1

    Macro action: RunSql

    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.
  • MSeda
    Recognized Expert New Member
    • Sep 2006
    • 159

    #2
    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

    or

    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.

    Comment

    • Umoja
      New Member
      • Nov 2006
      • 24

      #3
      Thank you MSeda, I was able to do it in the event procedure. Thank you very much.

      Comment

      Working...