|
P: n/a
|
Does anyone know to call a function residing in a module: I need it to
be called when my flash screen is launched when the app is opened. Here
is the code for the module (it sets some paramters for disallowing
special keys, etc.) (Should I use DoCmd?, Call?) I don't use modules
very often obviously (Thanks for any help!!):
Function SetStartupProperties() As Boolean
On Error GoTo SetStartupProperties_ERR
If gintSetStartup 0 Then
If gintSetStartup = 100 Then
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, False
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, False
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
SetStartupProperties = False
Else
ChangeProperty "StartupShowDBWindow", dbBoolean, True
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
SetStartupProperties = True
End If
Else
If Dir("C:\Program Files\BReadMe.txt") = "" Then
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, False
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, False
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
SetStartupProperties = False
Else
ChangeProperty "StartupShowDBWindow", dbBoolean, True
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
SetStartupProperties = True
End If
End If
SetStartupProperties_Exit:
Exit Function
SetStartupProperties_ERR:
MsgBox "The following error occured: -- " & Err.Description,
vbOKOnly + vbCritical, "SetStartupProperties Error"
GoTo SetStartupProperties_Exit
End Function | |
Share this Question
|
P: n/a
|
"Parasyke" <kress1963nov22@yahoo.comwrote in message
news:1164059485.314316.138390@m7g2000cwm.googlegro ups.com...
Does anyone know to call a function residing in a module: I need it to
be called when my flash screen is launched when the app is opened. Here
is the code for the module (it sets some paramters for disallowing
special keys, etc.) (Should I use DoCmd?, Call?) I don't use modules
very often obviously (Thanks for any help!!):
Just plain old...
SetStartupProperties
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com | | |
P: n/a
|
You won't be able to check the return value, but you could just move the
other code to the Load event of the Form that you set to be automatically
run at Startup in Tools | Startup.
Larry Linson
Microsoft Access MVP
"Parasyke" <kress1963nov22@yahoo.comwrote in message
news:1164059485.314316.138390@m7g2000cwm.googlegro ups.com...
Does anyone know to call a function residing in a module: I need it to
be called when my flash screen is launched when the app is opened. Here
is the code for the module (it sets some paramters for disallowing
special keys, etc.) (Should I use DoCmd?, Call?) I don't use modules
very often obviously (Thanks for any help!!):
Function SetStartupProperties() As Boolean
On Error GoTo SetStartupProperties_ERR
If gintSetStartup 0 Then
If gintSetStartup = 100 Then
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, False
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, False
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
SetStartupProperties = False
Else
ChangeProperty "StartupShowDBWindow", dbBoolean, True
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
SetStartupProperties = True
End If
Else
If Dir("C:\Program Files\BReadMe.txt") = "" Then
ChangeProperty "StartupShowDBWindow", dbBoolean, False
ChangeProperty "StartupShowStatusBar", dbBoolean, False
ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty "AllowFullMenus", dbBoolean, False
ChangeProperty "AllowBreakIntoCode", dbBoolean, False
ChangeProperty "AllowSpecialKeys", dbBoolean, False
ChangeProperty "AllowBypassKey", dbBoolean, False
SetStartupProperties = False
Else
ChangeProperty "StartupShowDBWindow", dbBoolean, True
ChangeProperty "StartupShowStatusBar", dbBoolean, True
ChangeProperty "AllowBuiltinToolbars", dbBoolean, True
ChangeProperty "AllowFullMenus", dbBoolean, True
ChangeProperty "AllowBreakIntoCode", dbBoolean, True
ChangeProperty "AllowSpecialKeys", dbBoolean, True
ChangeProperty "AllowBypassKey", dbBoolean, True
SetStartupProperties = True
End If
End If
SetStartupProperties_Exit:
Exit Function
SetStartupProperties_ERR:
MsgBox "The following error occured: -- " & Err.Description,
vbOKOnly + vbCritical, "SetStartupProperties Error"
GoTo SetStartupProperties_Exit
End Function | | |
P: n/a
|
I dont like macros, but just to give you more options there are two
ways of doing this with macros:
- you could create a macro and name it autoexec. then call the function
from the macro.
- Or you could name it something else and create a shortcut that
launches the database with the macro name as a parameter. | | Post your reply Help answer this question | | Question stats - viewed: 2477
- replies: 3
- date asked: Nov 20 '06
|