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 the command line to hide the database window? I'm using Access 2000

thanks,
Les
 
In vb help enter database window.Came up with the following:

Startup Properties Example

The following example shows a procedure named SetStartupProperties that passes the name of the property to be set, its data type, and its desired setting. The general purpose procedure ChangeProperty attempts to set the startup property and, if the property isn't found, uses the CreateProperty method to append it to the Properties collection. This is necessary because these properties don't appear in the Properties collection until they've been set or changed at least once.

Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "Customers"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, False
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True
End Sub

Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function

HTH
Dave
 
This post looks familiar. ;)

Using the DoCmd.PrintOut command will print the opened form.

The StartupProperties will not take affect until the next time you open the db wether you change them via code or from the menu.

You can hide/unhide the database window when needed 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
 
Youre right once again, I noticed this after posting.
Dave
 

Users who are viewing this thread

Back
Top Bottom