473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

By pass keys (Access 2000/3)

Hello all,

I tried that solution detailed below. However, I get the error "run-time
error 13. Type mismatch".

The offending line is:

Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)

Do you have any ideas?

Adonis.

Function DisableShiftKeyByPass() As Boolean
' The next time the database is opened
' after this function is run,
' the autoexec macro will not be bypassed,
' even if the shift key is pressed.
On Error GoTo errDisableShift
Dim db As Database
Dim prop As Property
Const conPropNotFound = 3270
Set db = CurrentDb()
db.Properties("AllowByPassKey") = False
DisableShiftKeyByPass = True

exitDisableShift:
Exit Function

errDisableShift:
' The AllowByPassKey property is a user-defined
' property of the database that must be created
' before it can be set. This error code will execute
' the first time this function is run in a database.
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function DisableShiftKeyByPass did" & "not complete
successfully."
DisableShiftKeyByPass = False
GoTo exitDisableShift
End If
End Function

Nov 12 '05 #1
3 2271
What data type is prop?
Try explictly declaring it as DAO.Property or more generically as a
Variant.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Adonis Walmsley-McCarthy" <aw*******@blueyonder.co.uk> wrote in message
news:GR*****************@news-binary.blueyonder.co.uk...
Hello all,

I tried that solution detailed below. However, I get the error "run-time
error 13. Type mismatch".

The offending line is:

Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)

Do you have any ideas?

Adonis.

Function DisableShiftKeyByPass() As Boolean
' The next time the database is opened
' after this function is run,
' the autoexec macro will not be bypassed,
' even if the shift key is pressed.
On Error GoTo errDisableShift
Dim db As Database
Dim prop As Property
Const conPropNotFound = 3270
Set db = CurrentDb()
db.Properties("AllowByPassKey") = False
DisableShiftKeyByPass = True

exitDisableShift:
Exit Function

errDisableShift:
' The AllowByPassKey property is a user-defined
' property of the database that must be created
' before it can be set. This error code will execute
' the first time this function is run in a database.
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prop
Resume Next
Else
MsgBox "Function DisableShiftKeyByPass did" & "not complete
successfully."
DisableShiftKeyByPass = False
GoTo exitDisableShift
End If
End Function


Nov 12 '05 #2
Hi there,

I understand what you are saying Allen, but I've already declared the
variable "prop" as a DAO property.

Any ideas?
Adonis.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
The code you posted contained:
Dim prop As Property

That's ambiguous, e.g. the ADOB library also has a Property type.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Adonis Walmsley-McCarthy" <a.********@blueyonder.co.uk> wrote in message
news:3f*********************@news.frii.net...
Hi there,

I understand what you are saying Allen, but I've already declared the
variable "prop" as a DAO property.

Any ideas?

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sujeet | last post by:
Hey guys, I want to import a database from SQL Server 2000 to MS Access with all indices and keys along with the tables. DTS does not export indices and keys, only the structure and the data. ...
7
by: Philip | last post by:
Hey all, (Access 2000) I've been having a horror story with this design problem. My Database is Structured like This: AUTHORS, BOOKS, PAGES. Those are the Tables and each Item in each table...
1
by: Aravindhan | last post by:
Hi, I had created a MS Access form. The form has an "Save" and a "Close" button. I would like to set short cut keys for these buttons as "Ctrl + S" and "Ctrl + C" keys. I heard that Send keys...
1
by: JM | last post by:
Hello, Using Access 2000 queries, you can reference(pass) form values directly using syntax like Forms!frmPaint!txtColor. I want to do a pass through query to SQL Server 2000, but I don't know...
3
by: ILCSP | last post by:
Hello, I'm fairly new to the concept of running action pass through queries (insert, update, etc.) from Access 2000. I have a SQL Server 2000 database and I'm using a Access 2K database as my...
2
by: ILCSP | last post by:
Hello, I'm in the process of changing our 'normal' Access 2000 update queries to Update Pass Through Queries. We have a SQL server 2000 database and we're using an Access 2000 database as our...
2
by: ILCSP | last post by:
Hello again, I'm still in the process of changing ms access queries to Pass through queries. We're using a SQL Server 2000 database with an Access 2000 DB as our front end. I trying to convert...
115
by: LurfysMa | last post by:
Most of the reference books recommend autonum primary keys, but the Access help says that any unique keys will work. What are the tradeoffs? I have several tables that have unique fields. Can...
4
by: Glenn309 | last post by:
I have an option group with 12 toggles within this group. I am having difficulty creating shortcut keys with "&" in the Name because my I would like to use 1-9 numerical keys which is ok, but I am...
5
by: marshmallowww | last post by:
I have an Access 2000 mde application which uses ADO and pass through queries to communicate with SQL Server 7, 2000 or 2005. Some of my customers, especially those with SQL Server 2005, have had...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.