Forms & Subform

G

Guest

I have a table that has the following fields:

Name, Date, Truck#, Tons, Ticket, Total

I would like to have a form that I only enter the Name, Date and Truck# once
but can enter Tons, Ticket and Total multiple times for that Name, Date and
Truck#.

How would I do this?

Thank you!
 
R

Rick B

Sounds like you need two tables.

One would have the Name, Date and Truck#.

Note: I would think this table would actually be further broken down. I'm
guessing truck# is a unique item and name is tied to the truck#? Would you
have multiple dates for a given truck number? If so, then you will need to
split this into two tables as well. If the Name can be tied to different
truck numbers, then you would need to further break it down.


The second table would have Tons, Ticket and Total. Plus one of the fields
from your first table that would act as a foreign key to tie the two tables
together.

This is called a one-to-many relationship and is the basis of building a
proper relational database.

Get your table structure right and the form will be easy to build.

Rick B
 
T

Ted

Jenn,

Have 2 different tables:
Table 1 with ID(autonumber, primary key), Name, Date, Truck# and Table 2
with ID, Tons, Ticket, Total

create a form with the record source as Table 1. then add a subform to
the form using Table 2 as the recordsource. When linking the subform to the
main form use ID as the link.

Then you will be able to enter multiple records per the Main record which
contains the Name, Date and Truck#

hope that helps...any questions let me know.
Ted
 
G

Guest

I can be more descriptive.

I have a query called "Employee List" that the Name field is set on. I have
a table called "Trucks" that the Truck # field is set on.

I need to enter an employee, a date, and a truck number. Each of these will
change day-to-day. No employee is tied to a certain truck.

The subform would be a list of all of the hauls for that employee, on that
day, with that truck.

Another dilemma is the subform has Tons, Ticket, EMPLOYEE %, and Total. The
Employee % comes from the Employee List query. What ever employee I choose
in the main form, their percentage needs to show up in the subform.

Any suggestions?
 

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