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 / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

Create an append query in visual basic

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lexander - 04 Jan 2006 23:57 GMT
I'm just starting out in Access and want to change all records in a field
from "Yes" to "No" using vb and not use an append query.  Then I can use a
button on my form to print the report based on the query and before returning
to the form reset the field.
Ofer - 05 Jan 2006 00:29 GMT
I assume you are looking for update query and not Append query.
You can run both using VBA

Docmd.OpenQuery "QueryName"
will run the query that update all the fields from Yes to No

Or
Docmd.RunSql "UPDATE TableName SET FieldName = False WHERE FieldName =True"

=====================================================
You might want to set the warnings  to false before running the update sql,
so the user wont be prompt with a message saying how many records will be
updated

Docmd.SetWarning False
' Run here the query or SQL
Docmd.SetWarning True

Signature

Please respond to the group if your question been answered or not, so other
can refer to it.
Thank you and Good luck

> I'm just starting out in Access and want to change all records in a field
> from "Yes" to "No" using vb and not use an append query.  Then I can use a
> button on my form to print the report based on the query and before returning
> to the form reset the field.
 
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.