I need to check a database and see if 4 queries exist
Query1
Query2
Query3
Query4
If those queries exist I want to rename them to Query1_Bad, Query2_Bad, Query3_Bad, Query4_Bad. How could I achieve this in vba?
I need to check a database and see if 4 queries exist
Query1
Query2
Query3
Query4
If those queries exist I want to rename them to Query1_Bad, Query2_Bad, Query3_Bad, Query4_Bad. How could I achieve this in vba?
Why would you need VBA?
Bing: Access VBA does query exist
http://www.devhut.net/2010/06/10/ms-...-query-exists/
http://stackoverflow.com/questions/3...-for-vb-macros
http://answers.microsoft.com/en-us/o...6-3f37ef3272f2
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
How else would I do it w/o VBA? Those links show how to find out if a query already exists - that part I am comfy with. I wasn't sure how to rename the query if it does exist. Using the top link as an example if DoesQryExist = True how do I then change the name of the query?
I would just manually change the query name in the Navigation pane.
I don't know if query name can be changed. The query can be copied with a new name then the original can be deleted.
Explore DoCmd.CopyObject
Review http://msdn.microsoft.com/en-us/libr...ffice.12).aspx
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.