Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Opening Access Report from Access DAP

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,2534
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Opening Access Report from Access DAP
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Opening Access Report from Access DAP - 3/31/2005 8:44:54 AM   
  sherilyn

 

Posts: 1
Score: 0
Joined: 3/31/2005
From:
Status: offline
Hi, I have a working access 2003 report(which calls a macro) and therefore cannot save it as a DAP. The workaround is to have a Data Access Page (in Access) with a button and write vb script behind the button on click event to launch the report that is in the very same access mdb. I am new to VB Script and am hoping someone can help me. I am getting an error of "Safety settings on this computer prohibit accessing a data source on another domain". Any suggestions greatly appreciated. Thks

Dim objConnection
Dim appAccess
Dim strRptName
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\CAMPAIGN REPORTS.mdb;"
strRptName = "WinReport"
Set appAccess = CreateObject("Access.Application")
Const acCmdZoom75 = 241
Const acViewPreview = 2
Const acExit = 2
strFilePath = Server.MapPath("C:\Documents and Settings\CAMPAIGN REPORTS.mdb")
appAccess.OpenCurrentDatabase strFilePath
appAccess.DoCmd.OpenReport strRptName, acViewPreview
appAccess.DoCmd.RunCommand acCmdZoom75
appAccess.DoCmd.Maximize
If appAccess.Visible = False Then
appAccess.Visible = True
End If
appAccess.Quit acExit
Set appAccess = Nothing
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Opening Access Report from Access DAP Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts