Results 1 to 2 of 2
  1. #1
    marisacoul is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    27

    Question Dropdown Menu or Msgbox on Right Click Anywhere in Database

    Hi all -

    I have an If/Else statement that determines whether or not you are an Admin. I've disabled right click for Users. When they right click, I'd like a message box or hover menu to pop up indicating that the right click has been disabled, and that if they need to copy or paste, they need to use Cntl+C etc. I would love for this to come up ONLY if they have logged in as a user. I have tried all different kinds of code in the Mouse Up event of the form but it just won't work!

    Here's the If/Else statement:


    If (Username = "User" And Password = "user1") Then
    DoCmd.RunCommand acCmdCloseWindow
    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    DoCmd.OpenForm "Add New Story", acNormal, "", "", acEdit, acNormal
    Beep
    MsgBox "You have successfully logged into HomeBase as a user.", vbOKOnly, ""


    DoCmd.OpenQuery "Contacts Extended", acViewNormal

    ElseIf (Username = "Admin" And Password = "admin1") Then
    DoCmd.RunCommand acCmdCloseWindow
    DoCmd.OpenForm "Add New Story", acNormal, "", "", acEdit, acNormal
    Beep
    MsgBox "You have successfully logged in to HomeBase as an admin.", vbOKOnly, ""
    DoCmd.SelectObject acTable, , True
    'this will enable all menu bars and tool bars
    Dim i As Integer
    For i = 1 To CommandBars.Count
    CommandBars(i).Enabled = True
    Next i

    Best,
    Marisa

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    You can't have it both ways - if you disable the right-click, then it does nothing - you can't "sort of" disable it.

    What you could do is disable the right click as you have done, then put some code in the form's On Open event to display the warning that Right-Click is disabled for ordinary users.

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

Similar Threads

  1. value from dropdown menu combined with ither text
    By lindegaard in forum Queries
    Replies: 2
    Last Post: 11-04-2015, 07:41 AM
  2. Deleting Combobox/Dropdown Menu Items
    By tanyalee123 in forum Access
    Replies: 2
    Last Post: 02-27-2015, 11:42 AM
  3. Creating a dependent dropdown menu
    By RamonEJ9 in forum Access
    Replies: 5
    Last Post: 02-18-2013, 06:45 AM
  4. Replies: 3
    Last Post: 08-29-2012, 10:53 PM
  5. Can I use dropdown menu selections in a sum?
    By REAPER_110 in forum Forms
    Replies: 1
    Last Post: 05-02-2011, 04:05 PM

Tags for this Thread

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