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!

Can I hide the CreateObject 1

Status
Not open for further replies.

99Chuck99

Programmer
Dec 11, 2003
67
US
I'm tring to print a report from a Access database from web page. The following code prints the report but I would like to hide the Access application from showing on screen objAcc.visible does not seem to work. Any ideas would be greatly appriciated.

<SCRIPT language=vbscript event=onclick for=command0>
Set objAcc = CreateObject("Access.Application")
objAcc.visible=false
objAcc.OpenCurrentDatabase "\\Kscboc2\Share\Jbosc\Rpi\Databases\FERB.mdb"
objAcc.DoCmd.OpenReport "AGENDA"
objAcc.Quit
Set objAcc = Nothing
</SCRIPT>
 
When I create the Access.Application object and OpenCurrentDatabase I don't get a window, so I believe the window becomes visible when you open the report.

I would try DoCmd.Minimize before (or after) opening the report. If minimizing isn't acceptable you can investigate hiding the window here:
 
You may try this:
objAcc.DoCmd.OpenReport "AGENDA", 0, , , 1

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

Part and Inventory Search

Sponsor

Back
Top