Advanced form design

G

Guest

IH
I’m trying to design a form that will display all my records on one page (if
then will all fit).
I got a table for customers - CustomerID, CustomerName, Address, City, Ect…
On the form I would like the CustomerID(s) and CustomerName(s) to be display
on the form in tabular form. The form should automatically add or delete
lines as the customer table changes from active to inactive customers ( the
customer table keeps a history of all the customer’s).
If I have 100 active customers the form should show all 100 CustomerID’s and
CustomerName’s
If the active customer’s change to 85 the form should display all 85
CustomerID’s and CustomerName’s
Now once that’s done I would like to add a command button to each Customer’s
name on the form so I can print a report for that customer only. The command
button’s should also be automatically add or delete as the customer table
changes.
Can this be done?
I’m still new to this I need a lot of detail in the creation of all this.

Thanks for any help
Gus CH
 
P

Pat Hartman\(MVP\)

--If I have 100 active customers the form should show all 100 CustomerID's
and
CustomerName's
If the active customer's change to 85 the form should display all 85
CustomerID's and CustomerName's----

Access provides three basic form types
Single
Continuous
Datasheet
There are also two more complex form types
Pivot table
Pivot chart

What you are describing is a continuous or datasheet style form. They will
show as many rows as there are in the table. You just have to scroll if
there are more rows than will fit on the first page. To make such a form
the first time, use the wizard. Once you see how they are made, you can
build them without the wizard.

If you use a continuous style form, you can add a command button to print a
report for the current record. Once the wizard generates the code, you may
have to modify it. At a minimum, you need to add a line of code to cause
the current record to be saved. So in front of the DoCmd.OpenReport method,
add:
DoCmd.RunCommand acCmdSaveRecord

If you use a datasheet style form, you can't use buttons. But, you can add
the same type of code as would be generated by the button wizard to the
double-click event of one of the form's fields. Then instead of clicking a
button, the user would double-click in a field to print the report for the
current customer.
 

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