Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    Location
    Eastern Pennsylvania, Pennsylvania, USA
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Validate befor closing Access (97sr2)

    Is there a way to either:
    Remove the ' x ' (close) button on the Access bar (to force users to use a command button)? or...test that there are no null fields before allowing the closing of Access? Thanks in advance

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

    Re: Validate befor closing Access (97sr2)

    There are several ways. If you do a Lounge Search, you'll find numerous discussions on this question.

    First, though, you need to decide whether you want to keep the database from closing, you want to keep a form from closing, you want to dump an incomplete record, or what.

    You also need to elaborate on what you mean by "null fields". Are these required fields that aren't filled in? If so, the record won't be saved if you've designed the table properly.
    Charlotte

  3. #3
    Star Lounger
    Join Date
    Mar 2001
    Location
    Eastern Pennsylvania, Pennsylvania, USA
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validate befor closing Access (97sr2)

    OK. I have a form with a start button that logs the system time then minimizes the form. I then need to make sure the user does not close Access, but minimizes to the taskbar, which is why I would like to get rid of the application 'x' close button. Also....I know a long time ago I saw a way to show the user name in the taskbar....but I can't remember where...any suggestions?? Thanks,

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

    Re: Validate befor closing Access (97sr2)

    Well, if you put the username in the apptitle of the application, that's what you'll see in the taskbar. That might solve your second problem. Have you done a Lounge Search for answers on the first problem?
    Charlotte

  5. #5
    Star Lounger
    Join Date
    Mar 2001
    Location
    Eastern Pennsylvania, Pennsylvania, USA
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validate befor closing Access (97sr2)

    Yes...A simple line of VBA ( DoCmd.RunCommand (acCmdAppMinimize)) did the trick. i needed to avoid the possibility of a user closing the app by mistake....as far as the 'user name' issue, I cannot name the app after them because it is a multi-user dbase (100+ users a day) in a network environment. I'll keep looking (R&D sounds more impressive !! Charlotte, Thanks for all the help, again! You are much appreciated, as well as all the other pros that are here for each other...DP

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validate befor closing Access (97sr2)

    You could set the user name in the title bar at run time.
    In the on open event of the first form the application opens set this:
    <pre>CurrentDb.Properties("apptitle") = CurrentUser()</pre>

    Francois

  7. #7
    Star Lounger
    Join Date
    Mar 2001
    Location
    Eastern Pennsylvania, Pennsylvania, USA
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validate befor closing Access (97sr2)

    Francois, I am getting a "Property Not Found" error. Is there a way around this.....Thanks in advance, DP

  8. #8
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Validate befor closing Access (97sr2)

    Hi,
    If you haven't previously set an AppTitle, then this property does not exist. You either need to set it to something and then change it with your code, or you need your code to check if it exists and if not, create a new property and append it to the database's properties collection.
    I don't think this will actually do what you want though - because it's a startup option, the value is only checked at startup. If you change it in code once the database has started, it will not take effect until the next time the database is opened.
    Regards,
    Rory

    Microsoft MVP - Excel

  9. #9
    Star Lounger
    Join Date
    Mar 2001
    Location
    Eastern Pennsylvania, Pennsylvania, USA
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validate befor closing Access (97sr2)

    Rory, I do have the app title set in the database properties. The scenario is that some users will have this open on thier own workstations, but some departments will have a few employees but only 1 pc, and will therefore have multiple instances of the same dbase open and minimized. I want them to be able to see thier name in the title on the taskbar, so when they complete a task they can easily open the instance they are working with, and complete the data entry for themselves....Thanks, Dp

  10. #10
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Validate befor closing Access (97sr2)

    If you've already set it once, then the property must exist. Have you checked spelling etc. to ensure that that's OK and also that you set it under Tools-Startup (I think that's where it was in 97) rather than under Database Properties? I was also being dumb earlier - you can use application.refreshtitlebar to make the change immediately take effect.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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