Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    5

    Unanswered: Resetting Fields.....Newbie

    I have a table that I must at times reset all of the entries in the whole table to defaults. Some of the fields are simple Yes/no and one is an interger.

    I do not know visual basic so I am trying to do this with a macro.

    I have one macro that opens the table ( or form ) and then does a Goto First Record. It then calls a second macro that sets the 4 fields to the default that I want. It then does A Goto Next record and then reverts back to the first macro.

    Now what do I put in the "Repeat Expression" entry on the macro line to get it to go through the table and stop without an error on the last entry in the table

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Resetting Fields.....Newbie

    Originally posted by Traffic2
    I have a table that I must at times reset all of the entries in the whole table to defaults. Some of the fields are simple Yes/no and one is an interger.

    I do not know visual basic so I am trying to do this with a macro.

    I have one macro that opens the table ( or form ) and then does a Goto First Record. It then calls a second macro that sets the 4 fields to the default that I want. It then does A Goto Next record and then reverts back to the first macro.

    Now what do I put in the "Repeat Expression" entry on the macro line to get it to go through the table and stop without an error on the last entry in the table
    SQLString="UPDATE MyTableNameHere SET Field1=XXX, Field2=XXX, Filed3=XXX ...;"

    Docmd.RunSQL SQLString

    And the problem with this is???

  3. #3
    Join Date
    Mar 2004
    Posts
    5

    Re: Resetting Fields.....Newbie

    Originally posted by M Owen
    SQLString="UPDATE MyTableNameHere SET Field1=XXX, Field2=XXX, Filed3=XXX ...;"

    Docmd.RunSQL SQLString

    And the problem with this is???
    Again I am completly new to this....

    This goes in the "Repeat Expression" entry on the macro ???

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Resetting Fields.....Newbie

    Originally posted by Traffic2
    Again I am completly new to this....

    This goes in the "Repeat Expression" entry on the macro ???
    Noooooo. This you have to run just once ...

  5. #5
    Join Date
    Mar 2004
    Posts
    5
    Thanks for fully explaining it....

    Sorry I even troubled you...............................

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by Traffic2
    Thanks for fully explaining it....

    Sorry I even troubled you...............................
    What do you mean?

Posting Permissions

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