Access do not have ability pass var?

  • Thread starter Thread starter HM
  • Start date Start date
H

HM

Hello,
I tried to convert my project from FoxPro to MS Access2K
but some how in Access do not have function to pass var
look like in FoxPro I have. Here is an example code in
FoxPro: (Allsite,site1,site2 are fieldname in table Clinic)

AllSite = "All Site"
Site1= "Hospital One"
Site2= "Clinic Two"

How to code in CmdPrintreport.Click() event to passing all
of these var. to report name "All Year 2003 Report" with
and without using query?
Thank you in advange for any sugestion.
HM
 
I don't understand what you mean "passing variables to" a report,
particularly since the "variables" you describe seem to be fields in a
table. Create an Access report with that Table as RecordSource and those
fields will be available to display in Controls on the Report.

In Access, a "variable" is used in VBA code, created with a Dim statement,
and is a temporary entity... if defined in a procedure, it ceases to exist
("goes out of scope" when you exit the procedure; if defined in the
declarations of a standard module, and declared Public, it is accessible
from any module in the database, and ceases to exist only when there is an
error-reset or the database itself is closed.

A "field" exists, as in FoxPro, in a "table" and is used for storing a value
even after the database is closed.

Larry Linson
Microsoft Access MVP
 
For the scenario you've described, you should have a second table that
contains the number and the description, and join that second table to your
main table.
 
Back
Top