PC Review


Reply
Thread Tools Rate Thread

Can I use a sub as a reports data source?

 
 
DanB
Guest
Posts: n/a
 
      9th Sep 2003
I have a function (although it could be set up as a sub)
that reads a table, does quite a bunch of involved stuff,
then sends out specified fields from selected records to
the immediate window. Can I have these fields go to an
access report instead? Do I need to send the results to
an interim table then the report would use that table for
it's data source? Surely there is a way to send data from
a function or sub directly to a report. I can't get my
report to accept the function as it's source of data.
Someone suggested using
Me.CurrentX = 2000
Me.CurrentY = 1000
Me.Print "This text should display in the report"
But I'm too dense to see how that would send selected
fields to an Access Report.
Thanks in advance for any and all help.
DanB

 
Reply With Quote
 
 
 
 
Tim Ferguson
Guest
Posts: n/a
 
      9th Sep 2003
"DanB" <(E-Mail Removed)> wrote in
news:56f701c376e5$4d465870$(E-Mail Removed):

>
> I have a function (although it could be set up as a sub)
> that reads a table, does quite a bunch of involved stuff,
> then sends out specified fields from selected records to
> the immediate window. Can I have these fields go to an
> access report instead?


Yes, but you'd need to call it from the report; for example in the Open or
the Format events and so on. You don't have to have a recordsource in a
report (just as a form doesn't have to be bound to a recordset either),
although it's the commonest use.

At bottom, you can simply have a blank page and print on it using code like
the one you have: put it in the Format event, for example.

Hope that helps


Tim F

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
data source for Reports =?Utf-8?B?QW1hdGV1cg==?= Microsoft Access 1 10th Sep 2007 06:20 PM
using a xml data source for crystal reports cti Microsoft ASP .NET 1 2nd Aug 2007 03:52 PM
Using a recordset as a reports data source GLepage Microsoft Access Reports 3 18th Apr 2007 07:27 PM
Modifying ODBC data source for multiple reports erick-flores Microsoft Excel Programming 5 6th Feb 2007 08:10 PM
Dyanamic reports using a cross tab query data source =?Utf-8?B?TGVpZg==?= Microsoft Access Reports 1 8th Apr 2005 04:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:49 PM.