PC Review


Reply
Thread Tools Rate Thread

Access Shift By Pass

 
 
Chris
Guest
Posts: n/a
 
      15th Oct 2008
Hi There, I am tring to create a Shift ByPass Key for my access database, but
getting error "Compile error: Expected end of statement". The code I managed
to find is:

Private Sub Command0_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")
If strInput = "holiday" 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


Can someone please advise?

Thanks in advance....

 
Reply With Quote
 
 
 
 
Paolo
Guest
Posts: n/a
 
      15th Oct 2008
Hi Chris,
change this
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"

with this
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"
and this
> 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"

with this
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"
HTH Paolo

"Chris" wrote:

> Hi There, I am tring to create a Shift ByPass Key for my access database, but
> getting error "Compile error: Expected end of statement". The code I managed
> to find is:
>
> Private Sub Command0_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")
> If strInput = "holiday" 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
>
>
> Can someone please advise?
>
> Thanks in advance....
>

 
Reply With Quote
 
RonaldoOneNil
Guest
Posts: n/a
 
      15th Oct 2008
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"

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"

"Chris" wrote:

> Hi There, I am tring to create a Shift ByPass Key for my access database, but
> getting error "Compile error: Expected end of statement". The code I managed
> to find is:
>
> Private Sub Command0_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")
> If strInput = "holiday" 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
>
>
> Can someone please advise?
>
> Thanks in advance....
>

 
Reply With Quote
 
BOSS
Guest
Posts: n/a
 
      15th Oct 2008
Thanks Guys, it works like a magic!!!




"Paolo" wrote:

> Hi Chris,
> change this
> 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"

> with this
> 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"
> and this
> > 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"

> with this
> 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"
> HTH Paolo
>
> "Chris" wrote:
>
> > Hi There, I am tring to create a Shift ByPass Key for my access database, but
> > getting error "Compile error: Expected end of statement". The code I managed
> > to find is:
> >
> > Private Sub Command0_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")
> > If strInput = "holiday" 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
> >
> >
> > Can someone please advise?
> >
> > Thanks in advance....
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shift by-pass key Domnic Microsoft Access 1 14th Apr 2009 08:26 AM
How to by pass shift key on startup =?Utf-8?B?Tm92YQ==?= Microsoft Access 1 20th Mar 2007 02:25 AM
Shift by pass - Setttings alpapak via AccessMonster.com Microsoft Access Forms 2 15th Mar 2006 11:10 AM
By Pass Using Shift Key =?Utf-8?B?RHdpZ2h0?= Microsoft Access 2 18th Feb 2005 12:29 AM
Prevent user by pass autoexec by pressing shift key Tim Microsoft Access Macros 1 4th Feb 2004 08:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:34 PM.