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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need empty input boxes on a form

Status
Not open for further replies.

maxrisc1

Technical User
Oct 4, 2009
1
US
I have to replace a number of PCs and monitors each day. I get a work order that has the customer data on it. I need to record the serial numbers of the old and new hardware when I arrive at the office.
So, I need to create a form that when printed will dynamically give me a number of empty lines based on the inventory from the table. The customer info I can pull directly from the table but I am not sure how to make it automatically add the correct number of fill in boxes/lines
For example if the work order says I have 2 PCs and 1 monitor the form would print out like so

Customer Name
Address

Serial Numbers
Desktop 1 New:___________
Desktop 1 Old:___________

Desktop 2 New:___________
Desktop 2 Old:___________

Monitor 1 New:___________
Monitor 1 Old:___________




Thanks in advance,
Allen
 
I gather that the Work Order for the customer just has the information:

Desktop = 2
Monitor = 1

rather than there being a child table with three rows in it.

In order to produce the report you need that child table as the data source for the report. That table just needs to have a single field "EquipmentType" which holds the type- "Desktop", "Monitor" etc. Run a loop for all the different types of equipment and use the DAO AddNew method to add the required number of new rows to the table for each type.

If you're not familiar with DAO then there's an example of how to use AddNew at
Geoff Franklin
 
Assuming you have the workorder with fields and records like:

[tt]
Equipment Qty
=========== =====
Desktop 1
Monitor 2
[/tt]
You could create a table [tblNums] with a single numeric field [Num] and values 1 - [some big number].
Then add tblNums to your report's record source and set the criteria under the [Num] field to <=[Qty].

This will create one record for Desktop and 2 for Monitor.

If you wanted to extend this further, you could create a table [tblOldNew] with a text field [OldNew] and values "Old" and "New". If you add this to your report's record source, you can add the OldNew field to the grid so that you get Old and New records.


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top