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 1 / February 2006

Tip: Looking for answers? Try searching our database.

using an update query to change multible things...need help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sparks - 27 Feb 2006 16:52 GMT
I have read in a bunch of files and saved the filename in the table
along with the idnumbers and names.
Thing is they sent us some files that have to be changed now
figures    LOL

in the table I have filename field and name field
no problem with an update if filename = "ABC.F" name ="BOB"

but I have 30 of these.
Can a query under criteria and update too.
can this be one on multible criteria and update statements.
if filename = "ABC.Z" name ="BOB"
if filename = "DEF.Z" name ="FRED"

not sure how

thanks for any help

Jerry
bruce@aristotle.net - 27 Feb 2006 18:59 GMT
Probably the quickest way to do this is to use the VBA switch()
function.  For example:

UPDATE the_table SET the_table.name =
Switch([filename]="ABC.C","BOB",[filename]="DEF.Z","FRED",True,[filename]);

You may have other criteria you want to add as well but remember to
include the "True,[filename]" criterion at the end as in the example so
those filenames that don't meet any of your criteria are left
unchanged.

HTH,
Bruce
bruce@aristotle.net - 27 Feb 2006 19:00 GMT
Probably the quickest way to do this is to use the VBA switch()
function.  For example:

UPDATE the_table SET the_table.name =
Switch([filename]="ABC.C","BOB",[filename]="DEF.Z","FRED",True,[filename]);

You may have other criteria you want to add as well but remember to
include the "True,[filename]" criterion at the end as in the example so
those filenames that don't meet any of your criteria are left
unchanged.

HTH,
Bruce
sparks - 28 Feb 2006 17:10 GMT
that did it thanks big time

Jerry

>Probably the quickest way to do this is to use the VBA switch()
>function.  For example:
[quoted text clipped - 9 lines]
>HTH,
>Bruce
 
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.