Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access reports guidance needed

Status
Not open for further replies.

tsp120

Programmer
May 21, 2003
52
US
I have experience working with forms in access, and using visual basic to perform certain functions. I have begun working on my first ever complex report and I do not understand where I should do vb code. With forms it seems that everything has onMouseOver, onClick, etc kind of functions, but with reports you just basically see Open, Close, Activate, etc.

What I want to do is perform certain tasks and queries based upon the given part of the report. How and where should I use vb code to take a value from a textbox and use it in a query or something for another textbox? Note that this value from the first textbox would be something that would change for each record on the report.

Any help would be appreciated,
Tim
 
your question is way, way, WAY too broad.

>How and where should I use vb code to take a value
>from a textbox and use it in a query or something
>for another textbox? Note that this value from
>the first textbox would be something that would
>change for each record on the report.

This was the only somewhat specific question
you had..
if one textbox's value is the basis for another's
calculation, you've got several options... from
the little I know, I'd reccommend using a query
with a subq, and treat them as regular fields.
ie, if your query is:
SELECT lender_name, subq1.sum_lent
FROM t_lender INNER JOIN (SELECT t_lenderID, SUM(balance)
AS sum_lent
FROM t_lender INNER JOIN
t_loan) subq1
on t_lender.lenderID = subq1.lenderID

then you'd just link each textbox to lender_name
and sum_lent.

if you chose to run a completely different query
under the hood in vba, you've got a lot of
choices to make and things to learn, like whether
to use ADO or DAO, using recordsets, etcetc.

-g
 
Hi,
In most cases, you will use the OnFormat event of the Detail section. This is a good place for calculations and special running totals.

HTH, [pc2]
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top