Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADP Disable Shift Problem 1

Status
Not open for further replies.

GooGoocluster

Technical User
May 12, 2005
71
US
Refered from this thread: thread705-403154

My CODE:

Code:
Function DisableShiftKey()
 
   Dim dbs As Object
   Dim prp As Object
   Const PROPERTY_NOT_FOUND As Integer = 3270
   On Error GoTo ErrorHandler
   
   Set dbs = Application.CurrentDb
 

   ' Try to set the property. If it fails, the property does not exist.

   CurrentProject.Properties.Add "AllowByPassKey", False



ExitLine:
   dbs.Close
   Set dbs = Nothing
   Set prp = Nothing
   Exit Function

ErrorHandler:
   MsgBox Err.Number & " " & Err.Description
   
   'If Err.Number = PROPERTY_NOT_FOUND Then
      ' Create the new property.
  '    CurrentProject.Properties.Add "AllowBypassKey", False
  '    Resume Next
  ' Else
   '   Resume ExitLine
  ' End If

End Function

I Know the error handler is the same as above, I had to take it out to see what error I was getting.

Its error Run time 91: Object Varriable or With block not set.

I was able to get the help files version to work with a MDB. but it wont work with my .adp

My version is 2002 SP3
 
Thanks just had to remove all the other garbage and it worked fine.


Anyone looking to Enable the shift key again here is the code

CurrentProject.Properties.Add "AllowByPassKey", True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top