473,769 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Property Not Found error when trying to set AllowBypassKey in A97

MLH
I call the following Sub and Function in frmLaunch's OnOpen
event code. I keep getting Property Not Found error for the
AllowBypassKey setting. Failure point is line #30 in the Function
(not the Sub). Ideas?

Sub SetStartupPrope rties()
On Error GoTo SetStartupPrope rties_Err
10 ChangeProperty "StartupFor m", dbText, "frmLaunch" '
Form you want to open at startup
20 ChangeProperty "StartupShowDBW indow", dbBoolean, False '
True will show the dbase window
30 ChangeProperty "StartupShowSta tusBar", dbBoolean, True
40 ChangeProperty "AllowBuiltinTo olbars", dbBoolean, True
50 ChangeProperty "AllowFullMenus ", dbBoolean, True
60 ChangeProperty "AllowBreakInto Code", dbBoolean, True
70 ChangeProperty "AllowSpecialKe ys", dbBoolean, True
80 ChangeProperty "AllowBypassKey ", dbBoolean, True '
The SHIFT key thing

SetStartupPrope rties_Bye:
Exit Sub

SetStartupPrope rties_Err:
Dim r As String, k As String, Message3 As String
r = "The following unexpected error occurred in Sub
SetStartupPrope rties, CBF on frmLaunch."
k = vbNewLine & vbNewLine & Str$(Err) & ": " & """" & Error$ &
"""" & ", line #" & Erl
Message3 = r & k
MsgBox Message3, 48, "Unexpected Error - " & MyApp$ & ", rev. " &
MY_VERSION$
Resume SetStartupPrope rties_Bye
End Sub

Function ChangeProperty( strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFound Error = 3270

10 Set dbs = CurrentDb
20 On Error GoTo Change_Err
30 dbs.Properties( strPropName) = varPropValue
40 ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
Dim r As String, k As String, Message3 As String
r = "The following unexpected error occurred setting " &
strPropName & " property in Sub ChangeProperty, CBF on frmLaunch."
k = vbNewLine & vbNewLine & Str$(Err) & ": " & """" & Error$ &
"""" & ", line #" & Erl
Message3 = r & k
MsgBox Message3, 48, "Unexpected Error - " & MyApp$ & ", rev. " &
MY_VERSION$
Resume Change_Bye

End Function

Nov 13 '05 #1
19 6273
Try downloading my sample shift key by-pass setter.

You can find it here:

http://www.members.shaw.ca/AlbertKal.../msaccess.html

Note how in the above, the ChangePrpperity code is different then yours.
(you need to add the shiftkey property if it errors out...and it seems your
code sample does not do that).
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com
http://www.members.shaw.ca/AlbertKallal
Nov 13 '05 #2
MLH
I'm trying, really, I am...

Functional lines in yours...
'Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties( strPropName) = varPropValue
ChangeProperty = True

Functional lines in mine...
10 Set dbs = CurrentDb
20 On Error GoTo Change_Err
30 dbs.Properties( strPropName) = varPropValue
40 ChangeProperty = True

They are too close for me. I noticed you have 4 argumentsto
the ChangeProperty function in your code...
Function ChangeProperty( strPropName As String, _
varPropType As Variant, _
varPropValue As Variant, _
dbs As Database) As Integer
' The current listing in Access help file which will
' let anyone who can open the db delete/reset any
' property created by using this function, since
' the call to CraeteProperty doesn't use the DDL
' argument

Do you think that has something to do with why my one
property is Not Found. The others are all found.
Try downloading my sample shift key by-pass setter.

You can find it here:

http://www.members.shaw.ca/AlbertKal.../msaccess.html

Note how in the above, the ChangePrpperity code is different then yours.
(you need to add the shiftkey property if it errors out...and it seems your
code sample does not do that).


Nov 13 '05 #3
It's not the functional lines that are the problem, it's the error handling.

Many of the properties to which you're referring do not exist by default:
you need to explicitly create them. That's the reason why

Const conPropNotFound Error = 3270

exists in your code: in your error handling section, you have to check
whether that's the error that's raised, and create the property if it is,
rather than treating it the way you do other errors.

Take a look at this version of ChangeProperty, from
http://www.mvps.org/access/general/gen0040.htm at "The Access Web"

Function ChangeProperty( strPropName As String, _
varPropType As Variant, varPropValue As Variant) As Integer
' The current listing in Access help file which will
' let anyone who can open the db delete/reset any
' property created by using this function, since
' the call to CreateProperty doesn't use the DDL
' argument
'
Dim dbs As Database, prp As Property
Const conPropNotFound Error = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties( strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFound Error Then ' Property not found.
Set prp = dbs.CreatePrope rty(strPropName , _
varPropType, varPropValue)
dbs.Properties. Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function

I haven't downloaded Albert's example, but I suspect it has similar logic in
it.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"MLH" <CR**@NorthStat e.net> wrote in message
news:h2******** *************** *********@4ax.c om...
I'm trying, really, I am...

Functional lines in yours...
'Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties( strPropName) = varPropValue
ChangeProperty = True

Functional lines in mine...
10 Set dbs = CurrentDb
20 On Error GoTo Change_Err
30 dbs.Properties( strPropName) = varPropValue
40 ChangeProperty = True

They are too close for me. I noticed you have 4 argumentsto
the ChangeProperty function in your code...
Function ChangeProperty( strPropName As String, _
varPropType As Variant, _
varPropValue As Variant, _
dbs As Database) As Integer
' The current listing in Access help file which will
' let anyone who can open the db delete/reset any
' property created by using this function, since
' the call to CraeteProperty doesn't use the DDL
' argument

Do you think that has something to do with why my one
property is Not Found. The others are all found.
Try downloading my sample shift key by-pass setter.

You can find it here:

http://www.members.shaw.ca/AlbertKal.../msaccess.html

Note how in the above, the ChangePrpperity code is different then yours.
(you need to add the shiftkey property if it errors out...and it seems
your
code sample does not do that).

Nov 13 '05 #4
MLH
Now I know why they call you guys MVP's.
That did the trick. 'preciate you setting me
straight on it. I would never have figured it
out.

xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxx
It's not the functional lines that are the problem, it's the error handling.

<censored>
Nov 13 '05 #5
MLH
Say, if I remember correctly, there was not
a convenient way around the SHIFT bypass
in Access 2.0, was there?
Nov 13 '05 #6
MLH
So, now that I know about this cool new way of using
property settings to control whether database window
shows or not and whether shift bypass is allowed, should
I do away with this old way of restoring the database
window on demand?

....

DoCmd.DoMenuIte m A_FORMBAR, 4, 4, 0, A_MENU_VER20

What's an up-to-date replacement procedure? Tired of living
in the past.
Nov 13 '05 #7
MLH <CR**@NorthStat e.net> wrote in
news:e4******** *************** *********@4ax.c om:
Now I know why they call you guys MVP's.


Because they can read the Access help files?

Hello?

The code for setting this is found in the A97 help file under
"bypassing startup settings." The code that is there automatically
handles the property not already existing.

It would *have* to be, as that's the nature of much of Access --
Access objects are just Jet objects with a lot of "custom"
properties (from the Jet point of view). And many of the properties
are not created until the point at which a value is set for them.

You can easily see this demonstrated by cycling through the
properties of any Access object. You'll see that the number of
existing properties in the properties collection is fewer than the
number of properties listed on the object's corresponding properties
sheet. That's because, until you *set* many of those property in the
property sheet (or through code), the property does not yet exist.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #8
MLH <CR**@NorthStat e.net> wrote in
news:2e******** *************** *********@4ax.c om:
So, now that I know about this cool new way of using
property settings to control whether database window
shows or not and whether shift bypass is allowed, should
I do away with this old way of restoring the database
window on demand?

...

DoCmd.DoMenuIte m A_FORMBAR, 4, 4, 0, A_MENU_VER20

What's an up-to-date replacement procedure? Tired of living
in the past.


Look at the help for DoCmd.SelectObj ect.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #9
MLH <CR**@NorthStat e.net> wrote in
news:2e******** *************** *********@4ax.c om:
So, now that I know about this cool new way of using
property settings to control whether database window
shows or not and whether shift bypass is allowed, should
I do away with this old way of restoring the database
window on demand?

...

DoCmd.DoMenuIte m A_FORMBAR, 4, 4, 0, A_MENU_VER20

What's an up-to-date replacement procedure? Tired of living
in the past.


BTW, I'd highly recommend that you spend a lot of time navigating
the help files. I'm not sure which version you're developing in, but
if it's A97, you've got the best set of help files for Access that
Microsoft ever produced.

You will learn a lot by familiarizing yourself with their structure
and terminology.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #10

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

Similar topics

4
46727
by: Devante | last post by:
Hi, I am fairly new to ASP.NET and have been working on a web form that will allow a user to upload images to a database. I have found a sample web form that I have been trying to get working, and the web form loads up fine but upon submitting the image, it comes with the following error: The ConnectionString property has not been initialized. Description: An unhandled exception occurred during the execution of the current web...
9
3725
by: pablo | last post by:
Dear NGers, I would like to change the alt-text with the changing of the image during a mouseover action. Can document.images.altView be changed dynamically? TIA, pablo
0
1625
by: Dalan | last post by:
Perhaps someone can share information on the methods to use to effect the automation process of creating the property to set the AllowBypassKey function. I was directed to: http://www.mvps.org/access/general/gen0040.htm and downloaded the function module that includes setting the fourth DDL part to true. It initially failed to compile using Access 97 because "PropType As DAO.DataTypeEnum" is not an automation type that Visual Basic...
1
5422
by: John Hunter | last post by:
I've recently had a nasty problem with the "Invalid reference to the property Form" error in subforms - nasty because it doesn't seem to consistently happen to all forms which contain the same structure and code. Judging by the forums I've researched, it's not an uncommon error. I'm happy to say I've found a simple solution. OVERVIEW: I have a main form (no record source) which contains two subforms. The subforms are not linked, but...
2
4644
by: dvorett | last post by:
I was wondering if there was a way to set a specific property to different vallues depending on the user? I need to users of the database to be able to add, edit, and read data in the forms but not be able to change the design in anyway. I have all the settings the way I want and then I figured I could just hold the shift on startup when I log in as the administrator, unfortunately that also works for the other users. Can I set...
0
11702
by: cwho.work | last post by:
Hi! We are using apache ibatis with our MySQL 5.0 database (using innodb tables), in our web application running on Tomcat 5. Recently we started getting a number of errors relating to java.sql.SQLException: Deadlock found when trying to get lock; Try restarting transaction message from server: "Lock wait timeout exceeded; try restarting transaction"; We get such errors generally on inserts or updates while applying a
6
3215
by: Bob Darlington | last post by:
I want to use the caption property for fields in a recordset as a condition in a loop. That is, I only want to consider those fields which have captions: For each fld in RecordsetName.Fields If fld.Properties("Caption") <"" then do something The problem is that all fields are included, even those with no caption set. I've tried IsMissing, IsEmpty and IsNull for the test but none will filter
9
5052
by: Eric | last post by:
Hi Everyone, I'm writing a UserControl that exposes a property of the type System.Drawing.Image, like this: Public Property DefaultImage() As Image Get Return propDefaultImage End Get Set(ByVal Value As Image)
2
7216
by: Dinsdale | last post by:
We have created a object library that implements the INotifyPropertyChanged.PropertyChanged to bubble changes up to higher level classes. For instance, we have a person class that can have relationships with other persons. If there is a change in the relationship (i.e. status, type etc) then we want the PropertyChanged event to fire and notify the top level Person object of that change. The PropertyChanged event is implemented as follows:...
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
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,...
0
10208
Oralloy
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...
1
9987
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,...
0
9857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8867
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5294
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...
2
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2812
bsmnconsultancy
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...

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.