Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete Certain Fields in Certain Tables? (a2002(10.4302.4219) SP-2)

    I

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Delete Certain Fields in Certain Tables? (a2002(10.4302.4219) SP-2)

    You declare tdf as a TableDef but try to set it to the collection of all TableDefs. Remove the line

    Set tdf = dbs.TableDefs

    and add the line

    Set tdf = dbs.TableDefs(i1)

    at the beginning og the loop. You can then refer to tdf instead of to CurrentDb.TableDefs(i1).

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete Certain Fields in Certain Tables? (a2002(10.4302.4219) SP-2)

    I

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Delete Certain Fields in Certain Tables? (a2002(10.4302.4219) SP-2)

    As I mentioned in my previous reply, the line

    Set tdf = dbs.TableDefs(i1)

    should be at the beginning of the loop i.e. <big>below</big> the line For i1 = ... It makes no sense to have this line <big>above</big> For i1 = ... because i1 hasn't been assigned a value yet.

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete Certain Fields in Certain Tables? (a2002(10.4302.4219) SP-2)

    Woops, sorry for my confusion, all is OK

    Thanks, John

Posting Permissions

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