Scenario help

  • Thread starter Thread starter Jasper Recto
  • Start date Start date
J

Jasper Recto

I have a simple table that holds 3 pieces of information:

Part
Ship Date
Weight


I want to make a form that has a drop down box that the user can select the
part.
Then I want it to ask how many containers are they going to enter for that
part.
Then I want it to ask for the weight of each container.

After they press enter, it would populate the table where each container
weight is a record in the table with the corresponding part number and ship
date.

How would I approach this? How can I make a form that will give me X amount
of fields for the user to put in their weights. The X must equal the number
of containers the user indicated before.

Once they enter in their information, it must update the table to add X
amount of records.

What would be a possible approach to this scenario?

Thanks,
Jasper
 
Jasper Recto said:
I have a simple table that holds 3 pieces of information:

Part
Ship Date
Weight


I want to make a form that has a drop down box that the user can select
the part.
Then I want it to ask how many containers are they going to enter for that
part.
Then I want it to ask for the weight of each container.

After they press enter, it would populate the table where each container
weight is a record in the table with the corresponding part number and
ship date.

How would I approach this? How can I make a form that will give me X
amount of fields for the user to put in their weights. The X must equal
the number of containers the user indicated before.

Once they enter in their information, it must update the table to add X
amount of records.

What would be a possible approach to this scenario?


Where does the ShipDate come from? Is it Null, to be filled in later, or is
it also specified on the form?

Can this table contain multiple sets of data for a given part? That is, if
I open the form, enter a part, and add 3 containers for that part, could I
later, open the form, and add another 7 containers for that part? And if
so, do the original 3 have to be identifiable as one set, while the next 7
have to be identifiable as another set?

Is it essential that no records be added to the table until the user has
provided the weight for each container?

One way I could think of to do this, subject to the answers to my questions
above, is to add all the necessary records to the table as soon as the user
has entered the part, the number of containers, and (if appropriate) the
ship date. The weight of all the records added would be Null at this point.
Then present the records to the user on a continuous subform so that the
user can fill in the weights.
 
The ShipDate will be entered in from the user on the main form.

The table CAN contain multiple set of data for a given part. However, it
does not have to be identified as a set. All we need to do is distinish
between the date, the part number and the weight of the crate.

Each record MUST have a date, part number and weight. It does not have to
be added as a group. I could be added to the table one at a time. I just
figured it would be easier for the user to enter in the ship date and part
number once and then enter in the weights of each container.

Are you suggesting that the user enter in the ship date and part number and
automatically update the table. Then, have the form show in a spread sheet
view and have them enter in the weights?

Thanks,
Jasper
 
Jasper Recto said:
The ShipDate will be entered in from the user on the main form.

The table CAN contain multiple set of data for a given part. However, it
does not have to be identified as a set. All we need to do is distinish
between the date, the part number and the weight of the crate.

Each record MUST have a date, part number and weight. It does not have to
be added as a group. I could be added to the table one at a time. I just
figured it would be easier for the user to enter in the ship date and part
number once and then enter in the weights of each container.

Are you suggesting that the user enter in the ship date and part number
and automatically update the table. Then, have the form show in a spread
sheet view and have them enter in the weights?


Exactly. The form would have a text text box or combo box for part number,
text boxes for ship date and number of containers, and a command button to
add that many records for the specified part number and ship date. The form
would also have a continuous (or datasheet) subform based on the table you'd
be adding records to, linked to the main form by part number and ship date,
so that it only shows the records (if any) that belong to that shipment. In
most cases, the subform would be empty until you click the command button to
add the containers.

So the user would enter the part number, ship date, and number of
containers, then click the command button. The Click event procedure for
that button would first verify that all three fields on the main form have
been filled in. Then, if they have been, it would insert that many records
into the table, picking up the part number and ship date from the fields on
the form, but leaving the weight field Null. It would then requery the
subform so that the newly added records would appear. It would be up to the
user then to fill in the weights.

The main problem I see with this approach is that there is no foolproof way
of forcing the user to fill in the weights for all the new records. You can
do a check, on closing the form, to see if there are any records there with
Null for the weight, and you can warn the user about it, but it's still
possible for the user to exit without filling in all the weights. That
could be good, or it could be bad, depending on your requirements.

If you must not allow there to be records in the table without weights, then
you might use a temporary table to hold the records to be created and
displayed by the subform, and then have some sort of code to commit the
transaction by copying the records from the temp table into the live table.
However, that's going to be need code that's a bit more complicated than
just doing what I've described above.
 

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

Back
Top