Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2004
    Posts
    277

    Unanswered: New with Loops help please

    I am trying to go through my main table and if [Invoiced] = Yes Then mark [ExpRec] = Yes

    How do I make it go through the table and do this?

  2. #2
    Join Date
    Feb 2005
    Location
    England.
    Posts
    232
    Easiest way is to do an update query.

    Create a new query in design view ...
    Add the table ...
    Change the query type to update...
    Select the field you want ...
    Tell the query what to update it to and put the criteria in.

    May I suggest you take a copy of the table before you do anything so you can back out if you need to!!

    Hope this helps.

  3. #3
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    do this with an update query instead

    Code:
    UPDATE tblMain 
    SET ExpRec = "Yes"
    WHERE invoiced = "Yes";

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    no need to loop, SQL can do it for you

    dim strSQL as string
    strSQL = "UPDATE yourMainTable SET ExpRec = True WHERE Invoiced = True;"
    docmd.runsql strSQL

    (if you really do mean "yes" replace True with 'yes' in both cases)

    izy
    Last edited by izyrider; 02-14-05 at 12:26. Reason: replaced " with '
    currently using SS 2008R2

  5. #5
    Join Date
    Dec 2004
    Posts
    277
    thank you all for the quick response

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •