Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maximizing Access window using VBScripts 1

Status
Not open for further replies.

newguy86

Technical User
May 19, 2008
226
US
I have an Access Db that I open using VBScripts, but everytime I use it the window for Access appears very small and I have to manually maximize it. Is there a way that I can automatically do this with the script that I already use?

Code:
Dim lfsobject
Dim dbsLTTFront

On Error Resume Next

Set lfsObject = CreateObject("Scripting.FileSystemObject")
lfsObject.CopyFile "*************************\Bowen Db.mdb", "C:\Program Files\Bowen Db.mdb"

If Err.Number = 0 Then
    Set dbsLTTFront = CreateObject("Access.Application")
    dbsLTTFront.AutomationSecurity = 1 'msoAutomationSecurityLow
    dbsLTTFront.Visible = True
    dbsLTTFront.OpenCurrentDatabase "C:\Program Files\Bowen Db.mdb"
    dbsLTTFront.userControl=true
Else
    'Err number 70, 7866 and -2147023170 sometimes occur with rampant clicking
    Msgbox ("The application takes a moment to load, please be patient.")
End If

Any assistance would be greatly appreciated.

Thanks,

Travis
 
dbsLTTFront.DoCmd.RunCommand 10 'acCmdAppMaximize

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top