473,796 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to set Startup Properties in MDE?

I'm trying to set startup properties with code after I make an MDB into an
MDE.

I have this code in the startup form's Form_Open event:

If IsItMde Then

For Each var In Array("Perform Name AutoCorrect", _
"Track Name AutoCorrect Info", "StartUpShowDBW indow", _
"StartUpShowSta tusBar", "AllowFullMenus ", "AllowBuiltInTo olbars", _
"AllowToolbarCh anges", "AllowSpecialKe ys", "UseAppIconForF rmRpt", _
"AllowBypassKey ", "AllowShortcutM enus")
Call SetStartupPrope rty(CStr(var), False)
Next

End if

Function IsItMde will correctly identify if it's an MDE or not, and the
properties will get set in an MDB (if I remove the If statement), but not in
an MDE.

Is this because it is not possible to set these options in an MDE? Should I
just set them in the MDB before I create the MDE? Why else would the
properties not set in an MDE?

Here is the SetStartupPrope rty function:

Public Function SetStartupPrope rty(strPropName As String, _
varPropValue As Variant)
On Error GoTo HandleErr
Dim db As DAO.Database
Dim prp As DAO.Property
Dim varPropType As Variant
Set db = CurrentDb
Select Case strPropName
Case "StartupFor m", "AppTitle"
varPropType = dbText
Case Else
varPropType = dbBoolean
End Select
db.Properties(s trPropName) = varPropValue
Exit_Here:
On Error Resume Next
Set db = Nothing
Set prp = Nothing
Exit Function
HandleErr:
Select Case Err.Number
Case 3270 'property not found
Set prp = db.CreateProper ty(strPropName, _
varPropType, varPropValue, True)
db.Properties.A ppend prp
Resume Next
Case Else
End Select
Resume Exit_Here
End Function
Nov 13 '05 #1
1 4771
The problem is not the MDE. It is certainly possible to set some of these
properties programmaticall y for an MDE.

However not all of these are properties of the Database object.

Some (such as the first one) are properties of the Application, so you to
set them like this:
Application.Set Option "Track Name AutoCorrect Info", False

--
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.

"deko" <de**@nospam.co m> wrote in message
news:4P******** ************@co mcast.com...
I'm trying to set startup properties with code after I make an MDB into an
MDE.

I have this code in the startup form's Form_Open event:

If IsItMde Then

For Each var In Array("Perform Name AutoCorrect", _
"Track Name AutoCorrect Info", "StartUpShowDBW indow", _
"StartUpShowSta tusBar", "AllowFullMenus ", "AllowBuiltInTo olbars", _
"AllowToolbarCh anges", "AllowSpecialKe ys", "UseAppIconForF rmRpt", _
"AllowBypassKey ", "AllowShortcutM enus")
Call SetStartupPrope rty(CStr(var), False)
Next

End if

Function IsItMde will correctly identify if it's an MDE or not, and the
properties will get set in an MDB (if I remove the If statement), but not
in an MDE.

Is this because it is not possible to set these options in an MDE? Should
I just set them in the MDB before I create the MDE? Why else would the
properties not set in an MDE?

Here is the SetStartupPrope rty function:

Public Function SetStartupPrope rty(strPropName As String, _
varPropValue As Variant)
On Error GoTo HandleErr
Dim db As DAO.Database
Dim prp As DAO.Property
Dim varPropType As Variant
Set db = CurrentDb
Select Case strPropName
Case "StartupFor m", "AppTitle"
varPropType = dbText
Case Else
varPropType = dbBoolean
End Select
db.Properties(s trPropName) = varPropValue
Exit_Here:
On Error Resume Next
Set db = Nothing
Set prp = Nothing
Exit Function
HandleErr:
Select Case Err.Number
Case 3270 'property not found
Set prp = db.CreateProper ty(strPropName, _
varPropType, varPropValue, True)
db.Properties.A ppend prp
Resume Next
Case Else
End Select
Resume Exit_Here
End Function

Nov 13 '05 #2

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

Similar topics

2
11934
by: robert walker | last post by:
hi all, to my webapp named mrf, i have added load-on-startup tag to mrf\WEB-INF\web.xml so i added a snippet like so <servlet> <servlet-name>loadDbProperties</servlet-name> <servlet-class>mrf.LoadDbPropertiesServlet</servlet-class>
3
2444
by: wolftor | last post by:
If I change the application title, it appears to change OK during the current session; but if I exit Access 97 and then run the application again, the change did not get saved. Any idea how to fix this and what's causing it? -- Regards, Peter
4
2308
by: Stuart Clark | last post by:
Hi, I am having quite a major problem with an access database. Basically, under "Tools => Startup", there are options to disable the Menu's (e.g. - file, tools etc), the toolbars, the main window, and in fact, everything. A vital database has had everything disabled, and so the menus and windows no longer load when I open the database. This means I can't get to the
7
6908
by: cefrancke | last post by:
I cant seem to find a straight answer on the following. I want to programmatically hide all menus except a basic custom report menu (during report preview) and right click pop-up A-Z sorting on datasheets (for subforms). I would like to do this on startup of the application. To be clear:
1
11324
by: cefrancke | last post by:
I have set the Startup properties to the following... All menus, toolbars, etc are turned off plus these are unchecked Allow Full Menus Allow Built-in Toolbars Allow Default Shortcut Menus Allow Toolbar/Menu Changes Use Access Special Keys
10
16156
by: PC Datasheet | last post by:
How can I programatically set the startup form when the database opens? Thanks! Steve
4
3908
by: Chris Ashley | last post by:
I have a class called App set as the startup object with the following code: Friend Class App Shared Sub Main() Dim FrmMain As New MainForm Application.Run(FrmMain) End Sub End Class In another form I use the following code:
3
4149
by: cj | last post by:
I found a good tutorial for making a windows setup program so I'm doing that. But when I add folders to the target machine list they don't seem to have one for the all users startup folder. I assume this will be a custom location and I added one called Startup. Now I'm looking at the properties menu for it but I'm not sure how to set the properties to specify the all users startup folder--if it exists, user startup if not.
4
1737
by: Jeff Ciaccio | last post by:
I'm new to vb.net and was wondering what the syntax is for application events such as starting up or shutting down. For example, if you would just like to get a user's name with an input box when they open the app or a form. Thanks -- Jeff Ciaccio Physics and AP Physics Teacher
0
9684
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
10236
jinu1996
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...
1
10182
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
10017
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...
1
7552
isladogs
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...
0
5445
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...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
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.