The way I do this is as follows:
In the application's startup options (Tools-Startup) under Display Form
enter the name of the form you want the user to see when the
application loads.
In that form's OnOpen event put =SetStartupOptions()
Also in the startup options uncheck the "Display Database Window." (You
can also do this from code and I have that if you need it.)
Create your own splash screen in Photoshop and name it the same name as
your application + .bmp (example MillionDollarApp.mdb,
MillionDollarApp.bmp) that way your custom spalsh screen will appear
instead of the Access splash screen.
Create a function named SetStartupOptions and paste it into a new code
module.
Function SetStartupOptions
On Error GoTo myErr
'Set startup options
'Microsoft Access options:
Application.SetOption "Confirm Record Changes", False
Application.SetOption "Confirm Document Deletions", False
Application.SetOption "Confirm Action Queries", False
Application.SetOption "Default Find/Replace Behavior", 1
Application.SetOption "Hyperlink Color", 12
Application.SetOption "Followed Hyperlink Color", 12
Application.SetOption "Behavior Entering Field", 2
Application.SetOption "Show Startup Dialog Box", False
Application.SetOption "Show Hidden Objects", False
Application.SetOption "Show Status Bar", False
Application.SetOption "Show Values Limit", 2000
Application.CommandBars.AdaptiveMenus = False
Application.Assistant.On = False
'Hide Toolbars:
DoCmd.ShowToolbar "Web", acToolbarNo
'hide more toolabrs as required
myExit:
Exit Function
myErr:
MsgBox Err.Number & "-" & Err.Description
Resume myExit
End Function
Create a custom toolbar named myReportToolbar and open it using:
DoCmd.ShowToolbar "myReportToolbar", acToolbarYes
on the OnOpen event of every report and close it on the onClose event
of every report using:
DoCmd.ShowToolbar "myReportToolbar", acToolbarNo
Create a custom menu bar that has only the sort commands named
DatasheetSortAZ and in the Menubar property under the "Other" tab put
"DatasheetSortAZ"
cefrancke@yahoo.com wrote:[color=blue]
> I cant seem to find a straight answer on the following.
>
> I want to programmatically hide all menus except a basic custom[/color]
report[color=blue]
> 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:
>
> On Statup of the .mdb/mde file...
>
> 1. Hide the Access Splash screen.
> 2. Hide the DB window.
> 3. Disable all menus/toolbars etc.
> 4. Show the Main form.
> 5. Enable a popup menu on right clicking on datasheet views for AZ
> sorting.
> 6. Enable, when reports are in preview, a toolbar for basic printing,
> zoom and closing of report.
>
> Please suggest the appropriate place to call the functionality,ie on
> FormOpen, FormLoad, etc...
>
> I would like to set as many features as I can with the 'Startup'
> properties under the tools menu and then set the rest with[/color]
programming.[color=blue]
>
> My intent is to wrap the code in a if..then..else to allow
> administrators full menus and other users just the limit features
> described above.
>
> Regards and TIA[/color]