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 / Forms Programming / August 2005

Tip: Looking for answers? Try searching our database.

Update Query through code?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gibson - 03 Aug 2005 17:40 GMT
I have a backend mdb and a frontend mdb. I have added a field to a table in
the backend using code. Now I need to update a query in the front end that
feeds a form to include the new field added to the table in the backend.
Can this be done through code thus the adding of the field and updating of
the query is done in at the same time as it were?
Ron Weiner - 03 Aug 2005 20:56 GMT
You want to modify the Sql property of the QueryDef for the query you are
interested in changing.  You probably want to write some code like this.

== Start Air Code ==

dim qdf as dao.querydef
currentdb.querydefs.refresh
for each qdf in currentdb.querydefs
   if qdf.name = "Name of the query we are interested in" then
       qdf.sql = "Your new Sql statement"
   end if
next

== End Air Code ==

Ron W
www.WorksRite.com

> I have a backend mdb and a frontend mdb. I have added a field to a table in
> the backend using code. Now I need to update a query in the front end that
> feeds a form to include the new field added to the table in the backend.
> Can this be done through code thus the adding of the field and updating of
> the query is done in at the same time as it were?
 
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.