Results 1 to 6 of 6
  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

    How do I Delete then Copy Object? (A2k (9.0.3821) SR-1)

    I

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

    Re: How do I Delete then Copy Object? (A2k (9.0.3821) SR-1)

    Why not just send them a new FE? It would be much simpler than what you're trying to do. I've built updaters like that, but they are only worth the time investment if you make extensive use of local lookup tables or if the user is allowed to create and save objects in the front end.
    Charlotte

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: How do I Delete then Copy Object? (A2k (9.0.3821) SR-1)

    If you run docmd.copyobject with an object that is already present in the target database it prompts you whether to replace the old with the new. So there is no need to delete the updated objects first. I do something similar sometimes, and it works OK.
    Before doing the update I back up the front end with a filecopy command.
    The reason I don't just replace the whole fe ( which I agree is what I normally do) is that I have one db used at a number of sites, and the data path is different at each site.
    Regards
    John



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

    Re: How do I Delete then Copy Object? (A2k (9.0.3821) SR-1)

    Hi Charlotte

    I do replace fe.mdb during the first few months after initial install, then it's a handfull of objects that need updating periodically, all my customers used the same fe.mdb, it zips to 10mb, just trying to save some time, would be interested looking at any code you may wish to share.

    Thanks, John

  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: How do I Delete then Copy Object? (A2k (9.0.3821) SR-1)

    Hi John

    Thanks for response

    I will take a look at docmd.copyobject, I assumed it would work like import and suffix object name with 1, 2, etc

    Thanks, John

    PS:

    The way I handle same fe.mdb at multiple sites is with a master preference table in fe.mdb, it contains multile records for each customer that include customer name, options, all defaults, db path information, etc.

    I set this up at install time

    When the application is started with customer code, the fe.mdb preference table is loaded with that customers preference from fe.mdb Master preference table.

    Then throughout the application in vba code use GetPref("Customer DB Path"), GetPref("Customer Name") or whatever to plug into standard variable driven code to carry out the customers processing.

    This technique allows me to write objects once and reuse it many.

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

    Re: How do I Delete then Copy Object? (A2k (9.0.3821) SR-1)

    If you use a registry hive instead of a local table, then replacing the FE won't lose the settings for the user and you won't have other user's settings on the same machine. Of course, that assumes that you don't have different users using the same machine ....
    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
  •