Command Button To run access query

mosh

Registered User.
Local time
Today, 13:26
Joined
Aug 22, 2005
Messages
133
Hello All,

Is there a module / macro that will run a specific query in Access? I have found the following code but can't get it to work;

Sub RunAccess()

Dim accessApp As Object

Set accessApp = GetObject("\\Belk1\ctrldept\FixDept\FY05 Capital Budget\Templates\FY05 Divison Budget.mdb", "Access.Application")

With accessApp

.Application.Visible = False

.Run "xptCentral_Summary.cmdExport_Central_Summary()"

End With

End Sub

Thanks

M
________
Medical marijuana dispensaries in lancaster california
 
Last edited:
Assuming you know the name of the query in question, you can use

DoCmd.RunQuery queryname
 

Users who are viewing this thread

Back
Top Bottom