report with user specified fields

  • Thread starter rogeliomarigomen via AccessMonster.com
  • Start date
R

rogeliomarigomen via AccessMonster.com

how do you make a report where the user specifies what data items to print.
for example a table for payroll with items: name,gross pay,deduction for
advances,deductions for loans and net pay

a report is needed where a form will ask the user what item to print(say,name
and gross pay only) and prints it out based on the user request the next
time the user specifies another set of items the report will still work.
 
A

Allen Browne

You can't dynamically add/remove controls from a report at runtime.

You could set up the report such that it has a text box for every field.
Then in the report's Open event, set the Visible property to No for each
text box you don't want to see, and change the Width and Left properties to
the visible text boxes take up all of the remaining space. You will need to
be comfortable with VBA code to achieve this. Measurements are in twips,
where 1440 twips = 1 inch.

If you have many more columns (like a financial journal), hopefully you have
not set up your table that way. In a normalized design, you would have a
related table with many records instead of a financial journal with many
columns. You would then use a crosstab query to generate the source for this
report.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top