View Single Post
  #2  
Old July 8th, 2009, 03:33 PM posted to microsoft.public.access
fredg
external usenet poster
 
Posts: 4,386
Default capturing/storing variables

On Wed, 8 Jul 2009 15:12:40 +0100, lez wrote:

Hi Guys,

Can anyone tell me the best way to load and store variables to call when
users are in my application. In particular, I have a number of
reports/invoices etc that are produced.

I have a table that the user adds comapny details, name, address etc that I
want to just load when a report/invoice is produced.

Many thanks


Your question is not very clear to me.
I'll guess you have information in a record in your table which you
wish to display on a report.

Add an unbound control to the report.
Set it's ControlSource to:
=DLookUp("[CompanyName]","TableName","[CompanyID] = " &
Me.[CompanyID])

Add another unbound control:
=DLookUp("[CompanyAddress]","TableName","[CompanyID] = " &
Me.[CompanyID])

etc.. for each additional field you need to include in the report.

[CompanyID] is the field in the report that identifies the Company.
The above code assumes [CompanyID] is a Number datatype.
If the actual datatype is Text, then use:
"[CompanyID] = """ & Me.[CompanyID] & """")

Of course you could always join this table to the other table(s) using
a query, and use that query as the report's record source.

If this isn't what you are looking for, please post back, clarifying
your question. Remember, we cannot see your database nor read your
mind.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail