Link to home
Start Free TrialLog in
Avatar of digitalwav
digitalwavFlag for United States of America

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!
Avatar of Amro Osama
Amro Osama
Flag of Egypt image

this should be changed in the report in the Database not for access ,
if you want to change it in VB ,, how do you view the report ? Datareport ? or what
just provide extra Info .... OHDev2004
Avatar of digitalwav

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.OpenCurrentDatabase 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
ASKER CERTIFIED SOLUTION
Avatar of Amro Osama
Amro Osama
Flag of Egypt image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's what I ended up doing. I pasted the code from VB that was calculating the dates and now things matched up.

Thanks!
Your welcome ,,
thank you
OHDev2004
Avatar of Mutiswan
Mutiswan

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

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.
Never mind- I answered your question on one of your open questions that relates to this.