Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    rename if exists (Access 2000)

    I want to make a code that renames a table from a set of tables.My tables are 15 and they begin with one and the same prefix, namelky Class, but with different sufixes for example :
    ClassFr
    ClassTr
    ClassTZ
    etc
    etc

    If one of the aboce tables exists, it should be rnamed to "Class"
    My code should look like that:
    If Exists ClassFr, OrClass Tr, etc etc
    'Then
    DoCmd.Rename "one of the specified tables", acTable, "Class"
    End If


    is it possible ?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: rename if exists (Access 2000)

    It's possible but what are you trying to accomplish? Normally, you don't rename tables casually like that. If the tables have the same structures but contain a different kind of data, then the proper way of handling it is to put the data all in a single table and have an additional field that identifies what kind of class it is.
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: rename if exists (Access 2000)

    i want to save efforts since all the tables i have in mind have the same structure but with different autunumber.I will send them to 15 end users under one and same name
    Instead of renaming wach of them manually i could do it with a function

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: rename if exists (Access 2000)

    I'm afraid I don't understand. If you're *sending* tables somehow to different users, you could query out the items needed for a particular user easier than you could mess around renaming tables so you can export them. What you're proposing sounds very risky to me, since you won't every be sure which table you might be working with.
    Charlotte

Posting Permissions

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