digitalwav
asked on
Passing a Report Title From VB to Access
I am using Access for reporting from a VB app. All works great, the query is passed, Access opens and we get the report. What I'd like is to be able to adjust the report title on the fly- for example:
Weekly reports run on a specific date range. That date range should be in the title, to identify this report from last weeks report.
Thanks!
Weekly reports run on a specific date range. That date range should be in the title, to identify this report from last weeks report.
Thanks!
ASKER
This is the code used to open Access w/ the query parameters etc. What I want to know is if there is a way to name the report at this point.
'open access and display selected report
Set objAccess = New Access.Application
objAccess.OpenCurrentDatab ase DatabaseLocation
'Give acViewPreview to preview the report.
objAccess.DoCmd.OpenReport ReportName, acViewPreview, , ReportWhereCondition
' Maximize the report window
objAccess.DoCmd.Maximize
' Show the Access window
objAccess.Visible = True
'open access and display selected report
Set objAccess = New Access.Application
objAccess.OpenCurrentDatab
'Give acViewPreview to preview the report.
objAccess.DoCmd.OpenReport
' Maximize the report window
objAccess.DoCmd.Maximize
' Show the Access window
objAccess.Visible = True
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's what I ended up doing. I pasted the code from VB that was calculating the dates and now things matched up.
Thanks!
Thanks!
Your welcome ,,
thank you
OHDev2004
thank you
OHDev2004
Digitalwav
Following your question that you published on experts-exchange on 04/26/2004 with Question Title"Passing a Report Title From VB to Access" you wrote -
"I am using Access for reporting from a VB app. All works great, the query is passed, Access opens and we get the report. e.t.c"
I think you can solve the problem that i have. I have an application running on
VB and Access as the Backend. I want to develop reports in access and run then from VB. Please help me with the code. I need my reports to use Queries from VB application.
e.g I have a table of Cassettes and i only want to display on my report only cassettes of a particular Author.
Select * From TableName Where actor="ActorName"
I need to pass my query.
Please help
Following your question that you published on experts-exchange on 04/26/2004 with Question Title"Passing a Report Title From VB to Access" you wrote -
"I am using Access for reporting from a VB app. All works great, the query is passed, Access opens and we get the report. e.t.c"
I think you can solve the problem that i have. I have an application running on
VB and Access as the Backend. I want to develop reports in access and run then from VB. Please help me with the code. I need my reports to use Queries from VB application.
e.g I have a table of Cassettes and i only want to display on my report only cassettes of a particular Author.
Select * From TableName Where actor="ActorName"
I need to pass my query.
Please help
ASKER
Start a new question in the VB area with some points and I'll be happy to pass you the necessary info!
I've done this successfully several time.
I've done this successfully several time.
ASKER
Never mind- I answered your question on one of your open questions that relates to this.
if you want to change it in VB ,, how do you view the report ? Datareport ? or what
just provide extra Info .... OHDev2004