Solved

Passing a Report Title From VB to Access

Posted on 2004-04-26
8
278 Views
Last Modified: 2010-05-02
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!
0
Comment
Question by:digitalwav
  • 4
  • 3
8 Comments
 
LVL 7

Expert Comment

by:OHDev2004
ID: 10923440
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
0
 
LVL 1

Author Comment

by:digitalwav
ID: 10927803
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
0
 
LVL 7

Accepted Solution

by:
OHDev2004 earned 500 total points
ID: 10930983
look man there is no way to do this within VB if you call the Report and it's stored in the DB

so there is another trick within ACCESS and its vb code also :)
in the designview of the report - RightCLICK then from the Menu choose "Build Event"
then choose "Code"
then write this part of code as you want it :
=====================

Private Sub Report_Open(Cancel As Integer)
Report.Caption = "Blablabla :)"
'Or
Report.Caption = Date
End Sub

Hope this Helps :)
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 1

Author Comment

by:digitalwav
ID: 10931353
That's what I ended up doing. I pasted the code from VB that was calculating the dates and now things matched up.

Thanks!
0
 
LVL 7

Expert Comment

by:OHDev2004
ID: 10931374
Your welcome ,,
thank you
OHDev2004
0
 

Expert Comment

by:Mutiswan
ID: 11315523
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

0
 
LVL 1

Author Comment

by:digitalwav
ID: 11316083
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.
0
 
LVL 1

Author Comment

by:digitalwav
ID: 11316180
Never mind- I answered your question on one of your open questions that relates to this.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question