Hello: Does anyone possibly know how to convert Access macros with the runsql macro using the visual basic editor. I am not a programmer but I need to know how to convert queries. Is there anyonw out there who can take my queries and help me convert them?

Yes you do. The query is like this “select * from table”

thank you!

OK, a little on referencing…

When you said macro, you meant VBA. Excel calls them macros(For reasons
unknown to me), but macros, IN ACCESS, are a GUI thing.

Where you put the RUNSQL command depends on how you want them to run!

As simple example:

Create a new module, or if you are using forms, go to the VBA Editor
behind the form. Add the following

'To run one query:

Public Function RunSQL()

DoCmd.RunSQL “Your SQL Statement”

End Function

Then you can ‘Call’ the function from anywhere: Call RunSQL()

HTH

  • Thank You
    =20
    Kevin Albrecht
    Senior Treasury Analyst
    Asset Liability Management
    Washington Mutual Bank FA
    206.490.5258 - Direct
    kevin.albrecht@wamu.net
    =20
    =20
    Confidentiality Notice: This communication may contain privileged or
    other confidential information. If you have received it in error, please
    advise the sender by reply email and immediately delete the message and
    any attachments without copying or disclosing the contents.=20
    Thank you.

Hello:

Do I need to add the “” between the SQL statement?

Yes, I want to create macros from SQL queries that are already=
created=2E The problem is my queries are over the 255 character=
limit for Access=2E I need to used the VBA editor, but I never=
used it before=2E Project and properies come up=2E Which area do I=
put the code in and do I use DoCmd=2ERunSQL in front of the select=
statement in order to make it run?

DO you just want to execute you queries in Accesss to SQL that access
VBA executes?

It is as easy as going into each query, going to SQL view, copying the
SQL that Access generates, & then in the VBA editor adding the command

DoCmd.RunSQL “THEN THE SQL YOU COPIED FROM THE QUERY”

  • Thank You
    =20
    Kevin Albrecht
    Senior Treasury Analyst
    Asset Liability Management
    Washington Mutual Bank FA
    206.490.5258 - Direct
    kevin.albrecht@wamu.net
    =20
    =20
    Confidentiality Notice: This communication may contain privileged or
    other confidential information. If you have received it in error, please
    advise the sender by reply email and immediately delete the message and
    any attachments without copying or disclosing the contents.=20
    Thank you.