DataBase - Print a Variable

Asked By Stefan
20-Nov-09 03:36 PM
I have a routine programmed in the a footer section of my report.

I have a variable

Dim CurrentClient as string

CurrentClient = "[Client]"

I would like to be able to print the variable currentClient in the footer on
the report.

I tried in the control source =[CurrentClient]

Does not work

Any help would be appreciated

Stefan
VBA
(1)
GetCurClient
(1)
Report
(1)
CurrentClient
(1)
  Duane Hookom replied to Stefan
20-Nov-09 04:26 PM
You will probably need a simple public function that returns the variable like:

Public Function GetCurClient() as String
GetCurClient= CurrentClient
End Function

You can then set a control source to the function.
--
Duane Hookom
Microsoft Access MVP
  Stefan replied to Duane Hookom
20-Nov-09 04:39 PM
Does that go in the Module I have written or does that go in a seperate module?

Or is that just replacing the DIM function for the variable?

sorry if the terminology is off I am new at VBA
  Duane Hookom replied to Stefan
21-Nov-09 12:28 AM
The variable you want to print should be a public variable. The function
should reside in a standard module.

You might want to read some articles on memory variable scope if you cannot
figure this out.

--
Duane Hookom
Microsoft Access MVP
Create New Account
help
Pass Parameter from Report (VBA to Macro) Access 2007 DataBase Hi, I have a macro called mcrRightClickItems. I have an Open Report with a Report Name which I filled in with "Report2". My question is how to pass from VBA to the Report Name different Reports so I do not have to hard code different macros for my report. I have shortcut menu bar which has the name of the macro to run. I hope this makes sense. Thanks, Les Access Security Discussions Access 2007 (1) VBA (1) Report (1) InVBA (1) RunCode (1) Stiphout (1) Macros (1) Can't you use
Page Footer DataBase hi, here's my scenario of my problem i had one report (Report A) and it has a page footer once i viewed it the page footer appears, but when i sub report the Report A on a another report (Report B) the page footer of Report A does show and it supposed to be shown at the page footer of Report B. its there anyway to show the page footer of Report A to Report B
Count and Filter Result DataBase My report has = Count(*) in the group header and I want to filter the results. Report Example: IDnumber Group Header Total of Reports Last Name First Name Idnumber 2 Smith Joe show the records of reports with the total of 4 or more. Access Reports Discussions Report (1) DateDiff (1) Ccumodsactionsother (1) Ccusanctionsother (1) Dateofreport (1) Reviewdate (1) Sonya (1) Unit (1) Try this in the query used as source for the report - -- SELECT [Last Name], [First Name], [Idnumber], Count([Idnumber]) AS [Total of Reports] FROM YourTable WHERE current code for my query. Where would I put the below infromation? SELECT [Minor Disciplinary Report].Last, [Minor Disciplinary Report].First, [Minor Disciplinary Report].IDnumber, [Minor Disciplinary Report].Unit, [Minor Disciplinary Report].Dateofreport, [Minor Disciplinary Report].[Gpsanction 1], [Minor Disciplinary Report].[Asddsanctions 1
Combine report DataBase On the A report, I would like to link or insert the total field that is on the other report, report B. Is there away that I can make the report A shows the report B textbox ? Please help. Thanks Chi Access Reports Discussions Report (1) Chi (1) Subreport (1) Textbox (1) DEWEY (1) Use a subreport. - - KARL DEWEY Build a little - Test a little No, not unless report B is displayed as a subreport on report A. If report B is not used