Results 1 to 14 of 14
  1. #1
    Join Date
    Mar 2004
    Posts
    7

    Unanswered: HOW TO LOCK SHIFT+ENTER? and change key

    Could someone please share with me how you password protected the SHIFT+ENTER to open DB design views? I am a little new to this so more details would be of great help!

    Also, is there a way to assign a different key (ie. instead of the SHIFT) key to open the DB design view?

    Thanks!
    Last edited by lcesung; 12-29-05 at 01:01.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    So 4 minutes after posting on this thread you though you'd start a new thread.

    What ever came or patience?

  3. #3
    Join Date
    Mar 2004
    Posts
    7

    Talking

    Hee Hee, are you able to help me?

    Thanks!!!

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Disable Shift Key

    If you don't want to make an mde file (which would not allow the user to see any code), you can try the following (based on a button called: bDisableBypassKey):

    Private Sub bDisableBypassKey_Click()
    On Error GoTo Err_bDisableBypassKey_Click
    'This ensures the user is the programmer needing to disable the Bypass Key
    Dim strInput As String
    Dim strMsg As String
    Beep
    'strMsg = "Do you want to enable the Bypass Key?" & vbCrLf & vbLf & _
    '"Please key the programmer's password to enable the Bypass Key."
    'strInput = InputBox(Prompt:=strMsg, Title:="Disable Bypass Key Password")
    Dim QI As Integer
    QI = MsgBox("Do you want to disable the shift key?", vbYesNo)
    If QI = 7 Then
    'If strInput = "pk" Then
    SetProperties "AllowBypassKey", dbBoolean, True
    Beep
    MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
    "The Shift key will allow the users to bypass the startup options the next time the database is opened.", _
    vbInformation, "Set Startup Properties"
    Else
    Beep
    SetProperties "AllowBypassKey", dbBoolean, False
    MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & _
    "The Bypass Key was disabled." & vbCrLf & vbLf & _
    "The Shift key will NOT allow the users to bypass the startup options the next time the database is opened.", _
    vbCritical, "Invalid Password"
    Exit Sub
    End If
    Exit_bDisableBypassKey_Click:
    Exit Sub
    Err_bDisableBypassKey_Click:
    MsgBox "bDisableBypassKey_Click", Err.Number, Err.Description
    Resume Exit_bDisableBypassKey_Click
    End Sub

    You might need to change a few things but hopefully this will help you in the right direction.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Quote Originally Posted by lcesung
    Hee Hee, are you able to help me?

    Thanks!!!
    Glad you find that funny. One thread per question, please.

    Answer the question posted in your first thread, it will help.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Mar 2004
    Posts
    7

    Talking

    Thanks so much pkstormy ... you are too kind. But, i'm afraid i don't really know where to put the piece of code that you provided me with. ie. should i place this code in the form, or module? How does this code get executed? Sorry for asking such basic questions but i'm more familiar with the MS Access GUI interface. I'd be very grateful if you could provide a sample database of where i could put this code.

    Thanks a mill !!!

  7. #7
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Shift key

    I'm not sure if the attachment will go through as I've been having trouble uploading zip files to this site but the code I supplied was put in on the On_Click event of a button created on the form. It's setup to turn it off or on when you click the button (password is PK). You should be able to copy the code supplied and just put it in for the On_Click event of any button you create on a form (I would label the button: bDisableBypassKey if you're going to copy all the code.) I would also recommend testing it on a blank Access mdb file.

    The key line of code is: SetProperties "AllowBypassKey", dbBoolean, False

    If the zip file does upload, then you will find this code in the "EnterHours" form of the mdb file.

    You should open it up using the shift key. It has linked tables in it so you would get some errors if you tried opening it up without the shift key.
    Last edited by pkstormy; 12-30-05 at 15:23.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  8. #8
    Join Date
    Mar 2004
    Posts
    7
    Thanks for the help, l've tried the suggested databases you posted, but I've had limited success, I hope you can help take a look at the attached DB and the error I am encountering Thax again!
    Attached Thumbnails Attached Thumbnails Error.jpg  
    Attached Files Attached Files

  9. #9
    Join Date
    Mar 2004
    Posts
    7
    I just want to clarify my question, actually, I am already successful in hiding the database window by using the start-up menu and I have created a “Menu Form” with a few buttons for users to go to desired forms and reports. (only the “Menu Form” appears once users click on the access program to open it).

    What I would like to ask is how can I password protect the database window even if the user knows the SHIFT+ENTER key sequence? I would ideally like to have a “Password Form” appear and prompt for an administrator password when users use the SHIFT+ENTER keys.

    Thanks a mill

    Jasmine

  10. #10
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Unless you have a need to deploy your application as an MDB - IE you have to give you users design rights to reports, then you can stop all this malarkey by deploying it as an MDE, as others have already suggested. Even if you give your users desing rights you can deploy this using a carefully selected slice of the data in a spearate MDE. You are not tied to one front end acessing one back end data store. Multiple MDB/MDE's front ends can reference the same data back end. Equally a / many front ends can refer to data in mulitple backend data stores. IE you can refer to tables in different JET MDB's concurrently.

    In any event their is little point in you opening the application as an administrator in MDB format as the moment you make changes you lock out other users, and they lock you out whilst they are using the app.

  11. #11
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    New db

    Try this (Sorry there was a function missing that was needed in the code.)
    Attached Files Attached Files
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  12. #12
    Join Date
    Mar 2004
    Posts
    7

    Talking

    Dear Paul, Thanks again for the new database. But I think I might have not been too clear in my explaination.

    I want to have a password prompt the user each time the user tries to access the design view with the SHIFT+ENTER key sequence. So if the user enters the correct password, then she can enter design view. If the incorrect password is entered, the user cannot access the database design.

    I've actually already hidden the database design window upon opening of the db file. I've done this with by unchecking all the options in the "Startup ..." menu under Tools. So when the user opens the db, she only will see a designated form.

    The database you gave me can be used to disable the shift key by entering a password, but how can I prompt the user each time they try the SHIFT+ENTER keys?

    THanks again!!

  13. #13
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    i really don't understand what you are trying to do, but this is how you do it:


    setup key preview in your _load event (or elsewhere if you like):

    private sub form_load()
    me.keypreview = true
    end sub

    intercept your chosen key combination:

    private sub form_keydown(keycode as integer, shift as integer)
    if keycode = vbkeyreturn and shift <> 0 then
    msgBox "do something intelligent here", , "SHIFT+ENTER"
    'smart code
    'smart code
    'smart code
    'smart code
    endif
    end sub

    izy
    currently using SS 2008R2

  14. #14
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Cool

    lcesung

    It seems for some reason you wish for others to be able to access form/report designing. Then why not just give them all their forms on their system/workstation. IF you have the database split with the backend on the server, you can just give your users their own forms to access the data on the backend. For users you don't wish to give the ablility to access form design, then give them the (MDE) version. Really though, I can't figure why you would wish to give your users the ability to Modify forms that are created to access data a certain way. Giving someone with no real knowledge of working with Access, or any database for that reason,the design ability would be an excercise in future disaster. You will be constantly having to respond to users saying, "I modified this form but it won't give me the data now...." and such things like that. Given the ability to change forms doesn't mean you will know HOW to design it to work with the data being pulled from the table/query. Though your reason doesn't seem logical/sensible to me, I guess you have your own agenda for doing this. You have been given great suggestions above though and on the other posting you started as well.

    have a nice one,
    BUD

Posting Permissions

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