Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / February 2007

Tip: Looking for answers? Try searching our database.

update query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lior Montia - 28 Feb 2007 11:40 GMT
Hi,

I have a button in a form that "on click" occurred
DoCmd.OpenQuery ("my_update_query")

How do I run this update query without any questions or messages ?  just to
do the update and that's all.

Thanks.
Jason Lepack - 28 Feb 2007 12:06 GMT
currentdb.execute "my_update_query", dbfailonerror

> Hi,
>
[quoted text clipped - 5 lines]
>
> Thanks.
Douglas J. Steele - 28 Feb 2007 12:20 GMT
Actually, assuming that my_update_query is the name of a stored query, I
believe you need to use:

Dim qdfUpdate As DAO.QueryDef

 Set qdfUpdate = CurrentDb.QueryDefs("my_update_query")
 qdfUpdate.Execute dbFailOnError

If you knew the SQL of that update query, then you could use the Execute
method on the Database object.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> currentdb.execute "my_update_query", dbfailonerror
>
[quoted text clipped - 8 lines]
>>
>> Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.