Showing database window

T

Tom Ross

Two questions.

If I elect not to show the database window on startup, is there a function
key combination that will open it?



Can the appearance of the database window be controled by the currentuser()
value? (some users will see it, others won't)


Thanks

Tom
 
D

Dirk Goldgar

Tom Ross said:
Two questions.

If I elect not to show the database window on startup, is there a
function key combination that will open it?

F11 will show it, unless you've unchecked the Startup option, UseAccess
Special Keys.
Can the appearance of the database window be controled by the
currentuser() value? (some users will see it, others won't)

You can show it via code, by using DoCmd.SelectObject with the
InDatabaseWindow argument set to True. If you have implemented
user-level security, so that users have to log in anf the CurrentUser()
function returns some value other than the default "Admin", then you can
use code like this somewhere:

Select Case CurrentUser()
Case "Bill", "John", "Mary"
DoCmd.SelectObject acTable, "tblProfile", True
Case Else
MsgBox "Sorry, you don't get to see the window."
End Select

Of course, you'd really implement some more complex method than that,
but you get the idea.
 
D

Danny J. Lesandrini

Tom:

You're right. I forgot about that.

I'm working at a shop right now where the developer placed this code
on all the main forms in his applications.

Private Sub Detail_DblClick(Cancel As Integer)
DoCmd.SelectObject A_FORM, "", True
Me.OpenOrderEntryForm.SetFocus
End Sub

This opens the window, even when the F11 shortcut key doesn't. You
could put it anywhere, even on a small hidden label that only you know
about, but he has it in the Detail double click event.
 
T

Tom Ross

Is there a way to hide the window without restarting the program? I tried
'False' for the last parameter in the sample below but it didn't hide the
window.
 
D

Dirk Goldgar

Tom Ross said:
Is there a way to hide the window without restarting the program? I
tried 'False' for the last parameter in the sample below but it
didn't hide the window.

First make sure the database window is the active window by selecting an
object in the window (as discussed earlier), and then execute

RunCommand acCmdWindowHide
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top