A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

related question concerning Access reports and VB modules



 
 
Thread Tools Display Modes
  #1  
Old October 30th, 2007, 07:58 PM posted to microsoft.public.access.reports
AdamY05
external usenet poster
 
Posts: 1
Default related question concerning Access reports and VB modules

If I have a function in a module that generates variables and then
calls a report, can I reference those variables in the report
directly, without having to write them to a table or elsewhere first?
For instance, in a text box within the report design view, can I enter
a text box control source as: function([variablename]) ?

Basically, the purpose of the function is to scan various tables for
data problems and then keep track of occurences. Since I did wrote
that code directly in VB without using queries or SQL, i'd prefer not
to have to redo it. And the variables are already populated, so it
seems trivial to just call them into a report.

Thanks in advance.

  #2  
Old October 31st, 2007, 03:24 AM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default related question concerning Access reports and VB modules

AdamY05 wrote:

If I have a function in a module that generates variables and then
calls a report, can I reference those variables in the report
directly, without having to write them to a table or elsewhere first?
For instance, in a text box within the report design view, can I enter
a text box control source as: function([variablename]) ?

Basically, the purpose of the function is to scan various tables for
data problems and then keep track of occurences. Since I did wrote
that code directly in VB without using queries or SQL, i'd prefer not
to have to redo it. And the variables are already populated, so it
seems trivial to just call them into a report.



Well, yes, you can do that kind of thing, but you will have
to write your own function to "scan" the variables. You can
not actually search your module for VBA variables by using
string with a variable name, so your function will need a
Select Case statement with a separate Case for each
variable.

I think it would be a whole lot simpler to use a Collection
instead of a bunch of variables.

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.