Holding down Shift (1 Viewer)

RuralGuy

AWF VIP
Local time
Today, 13:13
Joined
Jul 2, 2005
Messages
13,826
In conjunction with disabling the shift key in the BackEnd, I launch a small form that tells the user Table Access is only available using the FrontEnd and then quits Access.
 

GarageFlower

Registered User.
Local time
Today, 20:13
Joined
May 20, 2004
Messages
108
RuralGuy said:
In conjunction with disabling the shift key in the BackEnd, I launch a small form that tells the user Table Access is only available using the FrontEnd and then quits Access.


That doesnt help when the user holds shift and goes into the toolbar?

Could you elaborate more please
 

RuralGuy

AWF VIP
Local time
Today, 13:13
Joined
Jul 2, 2005
Messages
13,826
The toolbars never even show up, just the MsgBox with OK only. Press ok and the app closes.
 

GarageFlower

Registered User.
Local time
Today, 20:13
Joined
May 20, 2004
Messages
108
RuralGuy said:
The toolbars never even show up, just the MsgBox with OK only. Press ok and the app closes.

can you upload an example of this mate

sounds a pretty good solution
 

RuralGuy

AWF VIP
Local time
Today, 13:13
Joined
Jul 2, 2005
Messages
13,826
Here's two mdb's. One locked and one open. Have fun.
 

Attachments

  • LockBackEnd.zip
    25.1 KB · Views: 402

GarageFlower

Registered User.
Local time
Today, 20:13
Joined
May 20, 2004
Messages
108
RuralGuy said:
Here's two mdb's. One locked and one open. Have fun.

quality mate

i dont get how i can intergrate that into my database

i have a form that loads on startup

But if i use your solution wouldnt it just load this form and then close the database?
 

RuralGuy

AWF VIP
Local time
Today, 13:13
Joined
Jul 2, 2005
Messages
13,826
From your first post:
re-opens the database and hes straight into the backend
This is in the BackEnd *only* to keep users from inadvertantly opening the wrong db. The FrontEnd can easily be locked down with similar means so the user *must* use your forms to run the db.
 
Last edited:

DAW

Registered User.
Local time
Today, 12:13
Joined
Mar 22, 2006
Messages
70
Just been searching the forum for this very solution and have tried this code. I would like to add my pennyworth - ghudson's post is excellent stuff and I echo what jonnymenthol says "It's people like yourself that make this board what it is !!!".
 

ZMAN2

Registered User.
Local time
Today, 14:13
Joined
May 6, 2003
Messages
37
I agree that this is an excellent piece of code and an even better forum, but you can bypass this functionality altogether and enable/disable this property. Is there a way to prevent it from being changed in these situations?
 

selvsagt

Registered User.
Local time
Today, 21:13
Joined
Jun 29, 2006
Messages
99
I already have log on form, and have problems implementing the code

Hi,

I use the following code wich I have found on this forum to create a logonform at startup. I have tried to use the code from ghudson in this post, and implement it with my code.
I dont understand how I am supposed to do this.
I am newbie to vb, and need some help to figure out the logics.

Here's the code I use for the loginform, does anyone know how I can disable the shift key for anyone else than the admin user?
I have a table that contains usernames and passwords, and "admin" is one of them. I would like the "admin" user to be able to enable the shift key, and no one else.

Anyone?


Code:
Option Compare Database
Private intLogonAttempts As Integer

Private Sub Form_Open(Cancel As Integer)
'On open set focus to combo box
Me.cboEmployee.SetFocus
End Sub

Private Sub cboEmployee_AfterUpdate()
'After selecting user name set focus to password field
Me.txtPassword.SetFocus
End Sub

Private Sub cmdLogin_Click()

'Check to see if data is entered into the UserName combo box

    If IsNull(Me.cboEmployee) Or Me.cboEmployee = "" Then
            MsgBox "Skriv inn brukernavn.", vbOKOnly, "Obligatorisk felt"
            Me.cboEmployee.SetFocus
        Exit Sub
    End If

'Check to see if data is entered into the password box

    If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
            MsgBox "Skriv inn passord.", vbOKOnly, "Obligatorisk felt"
            Me.txtPassword.SetFocus
        Exit Sub
    End If

'Check value of password in tblEmployees to see if this matches value chosen in combo box

    If Me.txtPassword.Value = DLookup("strEmpPassword", "tblEmployees", "[lngEmpID]=" & Me.cboEmployee.Value) Then

        lngMyEmpID = Me.cboEmployee.Value

'Close logon form and open splash screen
        
        DoCmd.Close acForm, "frmLogon", acSaveNo
        DoCmd.OpenForm "sentralbord"

        Else
        MsgBox "Feil passord", vbOKOnly, "Ugyldig data!"
        Me.txtPassword.SetFocus
    End If
    
'If User Enters incorrect password 3 times database will shutdown
    
    intLogonAttempts = intLogonAttempts + 1
    If intLogonAttempts > 2 Then
        MsgBox "Du har tastet feil passord tre ganger.  Vennligst kontakt administrator.", vbCritical, "Begrenset tilgang!"
        Application.Quit
    End If
    
End Sub
 
Last edited:

theoorton

New member
Local time
Today, 22:13
Joined
Aug 23, 2006
Messages
2
I Used your code and it works ffine on my database if i hide he controll to unlock the shift key bt it does not seem to lick it again on next open or even on any open if i use the shift key to open it ig goes through ???

Please help i'm new to all this VBA coding
Thanx

P.S Its a nice code and works well but i think i'm using it wrong
 

Carl Foster

Registered User.
Local time
Today, 20:13
Joined
May 29, 2006
Messages
72
Hi, been reading this thread and I'm hoping to secure my database simply to distribute, so users can't access the code behind forms or change any designs.

I can't make it into MDE as I'm using Access 2003 and some of my users will be using 2000.

I read this solution in an Access book, but honestly I can't work it out. Here it is:

1) Create a workgroup to distribute with database
2) Remove admin user from Admins group
3) Remove all permissions for the Users group
4)Remove all design permissions for the Admin user for all objects in the database.
5) Do not supply a password for the Admin user

It says that Access will log on all users as the Admin user but because Admin has no user rights to the design of any object, users can not access objects or code in design view.

I tried it but got stuck on the remove Admin from Admins group and got an error that i can't do that.

Any ideas/comments on this?
 

billyr

Registered User.
Local time
Today, 15:13
Joined
May 25, 2003
Messages
123
I have used GHudson's code for some time now and love it.
I also like to embed a user ID and pw in the code for my start form to make sure I can get in no matter what the client does with the user table.
 

Teebird

Registered User.
Local time
Tomorrow, 04:43
Joined
Sep 3, 2006
Messages
60
ghudson Hi

Just a question - Do I name the module just "Public" and where do I put the bDisableBypassKey command button - I have a user logon form the loads first and then a switchboard or do I create a new form and put the button there?

Tee
 

Tezcatlipoca

Registered User.
Local time
Today, 20:13
Joined
Mar 13, 2003
Messages
246
Teebird said:
ghudson Hi

Just a question - Do I name the module just "Public" and where do I put the bDisableBypassKey command button - I have a user logon form the loads first and then a switchboard or do I create a new form and put the button there?

Tee

You call it AllowBypassKey. The command button for bDisableBypassKey can go anywhere you like, on any part of any form, no matter where that form is (or you can - as I do on my database - do away with it altogether and just have the module running).
 

wmburgess

New member
Local time
Today, 14:13
Joined
Oct 26, 2006
Messages
1
Access Security

I would like to say that ghudson's code works.

The only problem I see is that a user can hit Ctrl/Break and view code and password.

This solution is good enough for my problems.

Thanks.
 

ghudson

Registered User.
Local time
Today, 15:13
Joined
Jun 8, 2002
Messages
6,195
wmburgess said:
I would like to say that ghudson's code works.

The only problem I see is that a user can hit Ctrl/Break and view code and password.

This solution is good enough for my problems.

Thanks.
Not if your database is properly secured. You can also password protect the modules
Code:
.  I do both.
 

teiben

Registered User.
Local time
Today, 20:13
Joined
Jun 20, 2002
Messages
462
can't get it to work

Somewhere the code should state that you have to have a switchboard, the form opens to switchboard on startup
 
Last edited:

ghudson

Registered User.
Local time
Today, 15:13
Joined
Jun 8, 2002
Messages
6,195
teiben said:
Somewhere the code should state that you have to have a switchboard, the form opens to switchboard on startup
In my original response to this thread I did state... "Assign this to the OnClick event of a command (transparent?) button named "bDisableBypassKey".
Change the "TypeYourPasswordHere" default password.
This sub ensures the user is the programmer needing to disable the Bypass Key."
:rolleyes:
 

bluenose76

Registered User.
Local time
Today, 20:13
Joined
Nov 28, 2004
Messages
127
Hi,

I have used the code and when I click on my command button I am prompted to enter the password as directed.

my problem is that I can still hold down the shift key to bypass the startup form?

Please advise me what it is that I am doing wrong?

Thankyou
Bev.
 

Users who are viewing this thread

Top Bottom