473,387 Members | 1,374 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,387 software developers and data experts.

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", "StartUpShowDBWindow", _
"StartUpShowStatusBar", "AllowFullMenus", "AllowBuiltInToolbars", _
"AllowToolbarChanges", "AllowSpecialKeys", "UseAppIconForFrmRpt", _
"AllowBypassKey", "AllowShortcutMenus")
Call SetStartupProperty(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 SetStartupProperty function:

Public Function SetStartupProperty(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 "StartupForm", "AppTitle"
varPropType = dbText
Case Else
varPropType = dbBoolean
End Select
db.Properties(strPropName) = 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.CreateProperty(strPropName, _
varPropType, varPropValue, True)
db.Properties.Append prp
Resume Next
Case Else
End Select
Resume Exit_Here
End Function
Nov 13 '05 #1
1 4748
The problem is not the MDE. It is certainly possible to set some of these
properties programmatically 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.SetOption "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.com> wrote in message
news:4P********************@comcast.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", "StartUpShowDBWindow", _
"StartUpShowStatusBar", "AllowFullMenus", "AllowBuiltInToolbars", _
"AllowToolbarChanges", "AllowSpecialKeys", "UseAppIconForFrmRpt", _
"AllowBypassKey", "AllowShortcutMenus")
Call SetStartupProperty(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 SetStartupProperty function:

Public Function SetStartupProperty(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 "StartupForm", "AppTitle"
varPropType = dbText
Case Else
varPropType = dbBoolean
End Select
db.Properties(strPropName) = 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.CreateProperty(strPropName, _
varPropType, varPropValue, True)
db.Properties.Append 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
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>...
3
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...
4
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...
7
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...
1
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...
10
by: PC Datasheet | last post by:
How can I programatically set the startup form when the database opens? Thanks! Steve
4
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...
3
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...
4
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.