PC Review


Reply
Thread Tools Rate Thread

do loop or sql update

 
 
ifoundgoldbug@gmail.com
Guest
Posts: n/a
 
      18th Jan 2007
Greetings

i am having trouble with this sql statment

UPDATE Location SET Location.Location =
IIf(location!updateme=True,Forms!Series!NewLocation,location!Location)
WHERE [location];

it is changing EVERY location to the one at Forms!Series!NewLocation
instead of just the ones where updateme is true. am I missing something
in my statement or can this only be done in a vba do loop?

 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      18th Jan 2007
Try:

UPDATE Location
SET Location =Forms!Series!NewLocation
WHERE UpdateMe = True


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


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Greetings
>
> i am having trouble with this sql statment
>
> UPDATE Location SET Location.Location =
> IIf(location!updateme=True,Forms!Series!NewLocation,location!Location)
> WHERE [location];
>
> it is changing EVERY location to the one at Forms!Series!NewLocation
> instead of just the ones where updateme is true. am I missing something
> in my statement or can this only be done in a vba do loop?
>



 
Reply With Quote
 
ifoundgoldbug@gmail.com
Guest
Posts: n/a
 
      18th Jan 2007
i got it my where was too broad
(E-Mail Removed) wrote:
> Greetings
>
> i am having trouble with this sql statment
>
> UPDATE Location SET Location.Location =
> IIf(location!updateme=True,Forms!Series!NewLocation,location!Location)
> WHERE [location];
>
> it is changing EVERY location to the one at Forms!Series!NewLocation
> instead of just the ones where updateme is true. am I missing something
> in my statement or can this only be done in a vba do loop?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
loop through and update Steve Mackay Microsoft Excel Programming 0 12th Aug 2009 03:35 AM
For Loop SQL Update =?Utf-8?B?QWxlYWg=?= Microsoft Access VBA Modules 3 7th May 2007 01:16 AM
Update loop Alice Windows Vista Performance 0 23rd Feb 2007 12:06 PM
Update loop Alice Windows Vista Performance 0 23rd Feb 2007 12:05 PM
Is the update loop here to stay? (Update KB915597) =?Utf-8?B?ZHVzdHk=?= Security Signatures 1 5th Mar 2006 05:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:39 AM.