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.CreateProper ty("AllowByPass Key", dbBoolean, False)
Do you have any ideas?
Adonis.
Function DisableShiftKey ByPass() 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
DisableShiftKey ByPass = True
exitDisableShif t:
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.CreateProper ty("AllowByPass Key", dbBoolean, False)
db.Properties.A ppend prop
Resume Next
Else
MsgBox "Function DisableShiftKey ByPass did" & "not complete
successfully."
DisableShiftKey ByPass = False
GoTo exitDisableShif t
End If
End Function 3 2290
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*******@blue yonder.co.uk> wrote in message
news:GR******** *********@news-binary.blueyond er.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.CreateProper ty("AllowByPass Key", dbBoolean, False)
Do you have any ideas?
Adonis.
Function DisableShiftKey ByPass() 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 DisableShiftKey ByPass = True
exitDisableShif t: 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.CreateProper ty("AllowByPass Key", dbBoolean, False) db.Properties.A ppend prop Resume Next Else MsgBox "Function DisableShiftKey ByPass did" & "not complete successfully." DisableShiftKey ByPass = False GoTo exitDisableShif t End If End Function
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!
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.********@blu eyonder.co.uk> wrote in message
news:3f******** *************@n ews.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? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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.
When used "Import External Data" through Access(linking through ODBC)
it creadted liked tables, however with indices and keys. Can remove
these links and preserve only th stucture back. How do I do it.
Thanks
|
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 needs a unique ID# based on its context.
Primary Keys
AUTHORS = AuthorID - NO Duplicates
|
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 would work...But not sure How to use them in MS
Access forms.
Please provide me some information on How to proceed with this.
|
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 how to pass the form
values to SQL server without resorting to VB code. These canned
queries populate other elements of the form, and that's another reason
I don't want to write additional code. These queries were originally
set up merely...
|
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 front end.
I'm using a blank pass through query which gets the Transact-SQL part
inserted from a button in my form. After inserting the Transact-SQL
code into the pass through query, I 'open the recordset' to make the
query run.
However,...
| |
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 front end.
In the criteria of one of our update query fields, we use both the
isnull(field1) and Not IsNull(field2) then Field3, otherwise, set the
updated field as null. Here's my converted Pass Through Query :
UPDATE Vsel SET
VSel.Cert1 =...
|
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 this ms access query to a pass through and I'm
having quite a hard time doing it, so I hope you guys can help me. I
have a clients form and in this form there are 2 combo boxes where a
user can select a client's Type and Status. One for each. ...
|
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 I use them as
primary keys or should I define an autonum primary key?
One table has information about the 50 states in the US. The table
looks like this:
|
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 unable to create a two key shortcut to the remaining toggles eg: 10, 11, 12. Hope I am not expecting to much from Access 2000. Any suggestions would be greatly appreciated.
Thanks Glenn
|
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
pass-through queries fail due to intermittent connection failures.
I can easily restablish a connection for ADO.
My problem is with pass-through queries.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |