Sabtu, 31 Desember 2011

[MS_AccessPros] Re: Hide Database window

 

Bill,
I input the code you suggested below on the "got focus" of the startup form. I received an error message. "Ambiguous name detected"
Was there something obvious I missed.

Bill
Minnesota

Bill

Thanks, I will try this in the database right after I make a copy of it. I
have locked myself out of a database before.almost, I was sweating.
Bill .the newbee

MN

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Bill Mosca
Sent: Tuesday, December 20, 2011 3:30 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: Hide Database window

Bill

Keep in mind you still are a bit of a newbee. Doing all this hiding might
> > > > > bite you in the butt if you don't know what you are doing. You need a back
> > > > > door in case you lock yourself out. The default back door is to hold down
> > > > > the shift key while you open the database. But you can even disable that
> > > > > option.
> > > > >
> > > > > Do this ONLY in your production copy, not in your development copy.
> > > > >
> > > > > Set up your startup form under Options>Current Database.
> > > > >
> > > > > In that form's code, put this:
> > > > >
> > > > > Private Sub ShowHideRibbon(bolShowRibbon As Boolean)
> > > > > 'Purpose : Shows or hides Ribbon depending on Boolean argument.
> > > > > ' Can be run in versions older than 2007 with no ill effects.
> > > > > 'DateTime : 4/11/2011 08:03
> > > > > 'Author : Bill Mosca
> > > > > 'Requires :
> > > > > On Error Resume Next
> > > > >
> > > > > 'Hide or restore ribbon in versions 2007+.
> > > > > If bolShowRibbon = True Then
> > > > > DoCmd.ShowToolbar "Ribbon", acToolbarYes
> > > > > Else: DoCmd.ShowToolbar "Ribbon", acToolbarNo
> > > > > End If
> > > > >
> > > > > End Sub
> > > > >
> > > > > Private Sub ChangeProperty(db As Database, _
> > > > > strPropertyName As String, _
> > > > > varPropertyType As Variant, varPropertyValue As Variant)
> > > > >
> > > > > On Error GoTo err_PROC
> > > > > db.Properties(strPropertyName) = varPropertyValue
> > > > >
> > > > > exit_PROC:
> > > > > Exit Sub
> > > > >
> > > > > err_PROC:
> > > > > 'If property not found, create it.
> > > > > If Err = 3270 Then
> > > > > Dim prpNew As DAO.Property
> > > > > Set prpNew = db.CreateProperty(strPropertyName, varPropertyType, _
> > > > > varPropertyValue, True)
> > > > > db.Properties.Append prpNew
> > > > > Else
> > > > > MsgBox Err.Description, vbCritical
> > > > > End If
> > > > >
> > > > > End Sub
> > > > >
> > > > > Private Sub Form_Load()
> > > > > ChangeProperty db, "StartupShowDBWindow", dbBoolean, False
> > > > > Call ShowHideRibbon(False)
> > > > > End Sub
> > > > >
> > > > > Close the database and re-open it. That will run the code. Close it again
> > > > > and the next time it opens going forward the ribbon and the database window
> > > > > will be hidden.
> > > > >
> > > > > Regards,
> > > > > Bill Mosca, Founder - MS_Access_Professionals
> > > > > http://www.thatlldoit.com
> > > > > Microsoft Office Access MVP
> > > > > https://mvp.support.microsoft.com/profile/Bill.Mosca
> > > > >
> > > > > --- In MS_Access_Professionals@yahoogroups.com
> > > > > <mailto:MS_Access_Professionals%40yahoogroups.com> , "Bill Singer"
> > > > > <Bill.Singer@> wrote:
> > > > > >
> > > > > > I have been looking for a way to hide the database window. Once a form
> > > > > > opens in popup mode I would like to hide the database window. I do not
> > > > > > want the user to have access to or even see the ribbon.
> > > > > >
> > > > > >
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > >
> > > > > >
> > > > > > Bill Singer
> > > > > >
> > > > > > MN
> > > > > >
> > > > > >
> > > > > >
> > > > > > [Non-text portions of this message have been removed]
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > [Non-text portions of this message have been removed]
> > > > >
> > > >
> > >
> >
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar