Results 1 to 4 of 4
  1. #1
    pfales is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    23

    Question need Scripting help

    Hello,


    I am hoping to get som really clear guidance on an issue I am having. I am pretty new to programming in any sense of the word but with the help of a friend I was able to develop a script that runs when a form is opened. What I would like to do is modify this script so that "IF" the result is False the button not only will not be enabled but would not even be visible to the user.
    The script I currently have (and it works) is as follows:

    If User.AccessID = 1 Then
    Me.cmdUserSettings.Enabled = True
    Else
    Me.cmdUserSettings.Enabled = False
    End If

    Exit_Form_Open:
    Exit Sub
    Err_Form_Open:
    MsgBox Err.Description
    Me.Visible = True
    Resume Exit_Form_Open

    The other item I am wanting to do is add an additional button that will act exactly the same way. Can I add the information for the button into the script that I have or do I have to script it a different way?
    Any help and guidance would be greatly appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Change Enabled to Visible for the first. You could set both properties but it would be superfluous. You can add lines within the test to affect another button.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pfales is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    23

    Thumbs up need Scripting help

    pbaldy,
    Thank you, I was wondering if that would work or if I needed to do something different.

    Last edited by pfales; 05-29-2013 at 12:38 PM. Reason: Please close this thread, pbaldy provide the perfect advice.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. VBA Scripting
    By M155_Access in forum Programming
    Replies: 9
    Last Post: 05-24-2013, 12:09 PM
  2. Login Form and VBA scripting
    By data808 in forum Security
    Replies: 4
    Last Post: 02-27-2013, 12:01 AM
  3. Replies: 1
    Last Post: 09-20-2012, 03:37 PM
  4. VBA Scripting
    By data808 in forum Access
    Replies: 1
    Last Post: 08-26-2012, 11:29 PM
  5. Connect via ODBC and vb scripting or php
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-28-2010, 08:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums