Database Window Prob

Les

Registered User.
Local time
Today, 22:36
Joined
Nov 20, 2002
Messages
45
I have a database that opens without displaying the database window. I have a button in a form that will print another form. The problem is when the button is clicked the database window shows up.

Can anyone tell me how to keep the database window from showing up?

thanks,
Les
 
TY for the speedy response.

What exactly is the code to hide the database window?
 
Well actually I meant the code behind the command button if you're using VBA or the macro.

But you can hide the window by setting the startup properties in the tools menu. Tell it not to display the window on opening the db. Then it shouldn't show.
 
I see... that is the problem, I set the startup to not display the window but when the print form button is clicked.. voila! the database window shows up.
 
Please HELP!
I need to know the command line to hide the database window.
 
I'm using Access 2000 ... DoMenuItem doesn't work on this version anymore.
 
Sorry, forgot to get back to you.

I need to know what the command button is programmed to do. Does it run a macro or a VBA procedure?
 
TY Rob... the button prints another form (the whole form... not one record)

Private Sub Command1_Click()

Dim stDocName As String
Dim MyForm As Form

stDocName = "Another Form"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.name, False

End Sub

again,
Les
 
I don't need to open the form, just print it. Printing is not my problem the database window is.

ty,
Les
 
Oops. Sorry, I haven't used the printout command. But let me ask you this. Is the "Another form" already open when you try to run this procedure?
 
You can also hide/unhide the database window with code...

'Hide the database window
DoCmd.SelectObject acTable, , True
DoCmd.RunCommand acCmdWindowHide

'Unhide the database window
DoCmd.SelectObject acTable, , True

I suggest that you use a report to print the form data. I believe that you are displaying the database window with the "DoCmd.SelectObject acForm, stDocName, True" line.

HTH
 
Yes, where the button is.

Maybe saving the form as a report is my only answer and using openreport.

ty,
Les
 

Users who are viewing this thread

Back
Top Bottom