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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|