+ Reply to Thread
Results 1 to 5 of 5

Overwriting problem.

  1. #1
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Exclamation Overwriting problem.

    Hi Guys,

    I hope someone can help, and i'm sure you guys will be able to.

    I have a single spreadsheet which simply has a cover and a button that opens a userform. when the form is completed they user selects the done button. This opens another spreadssheet and logs the captured data in the relevant sheet.

    however when 2 people try to enter data at the same time they are unable to do so obviously because someone is already in the file.

    i have set the done button to open the file, eneter the data, save and close
    but is there anything else i can do to prevent this happening like a loop that check to see if the file is closed then runs the done command or waits until it is closed then runs?

    cheers for reading my threat and thanks

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    This code checks if a specified workbook is open

    Please Login or Register  to view this content.
    Adapt this test code into your code

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Smile Thanks Roy

    Thanks for the quick reply Roy.

    So if attach that to the CmdAdd button at the start is should check if it's open and then open it if it's not. Also when it is open does it wait till it is closed until it opens to prevent overwriting.

    sorry to be a pain buddy and i really appreciate the advice.

    Cheers Dave

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Place the main code (the function) in a standard module.

    Then in your button add something like

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Thumbs up Cheers Roy

    Nice one Roy,

    You Da' Man

    Appreciate all the help, one day i will be in your shoe's!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1