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 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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>...
|
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...
|
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...
|
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...
|
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...
|
by: PC Datasheet |
last post by:
How can I programatically set the startup form when the database opens?
Thanks!
Steve
|
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...
|
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...
|
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...
|
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,...
|
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$) {
}
...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
| |