Having trouble with forms, queries, and tables.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am creating a Database where I have different Jobs and under each job I
want to select which companies I want to use for that job. I created a form
where each job is a page, and in each page is a subform where I can select
which companies I want to use. I am using a combo box to select which
company I want to use. A query is the source for that combo box. The problem
I am having is when I select a company it does not use the current entry in
the table, but it creates a new entry into the table with a new unique
number. Sorry if this sounded choppy.
 
Joey,

A new record in *which* table?

From your description, I would assume you have 3 tables here. A Jobs
table, a Companies table, and an Assignment table (or whatever you have
named them). The Assignment table would have a JobNumber (or
equivalent) field, and a CompanyID (or equivalent) field, so that we see
which companies assigned to which jobs. The subform would be bound to
this Assignment table. Is that something like your design?
 
I am creating a Database where I have different Jobs and under each job I
want to select which companies I want to use for that job. I created a form
where each job is a page, and in each page is a subform where I can select
which companies I want to use. I am using a combo box to select which
company I want to use. A query is the source for that combo box. The problem
I am having is when I select a company it does not use the current entry in
the table, but it creates a new entry into the table with a new unique
number. Sorry if this sounded choppy.

What's your table structure? I suspect you need THREE tables not two: Jobs;
Companies; and CompaniesUsed. The latter table would have fields for the JobID
(a link to the primary key of the jobs table) and the CompanyID (linked to
Companies), and perhaps other fields if you want to track other information
about *this* company on *this* job. You'ld use a Form based on jobs, with a
subform based on CompaniesUsed - and yes you *do* want to add a new record (to
CompaniesUsed, not to the other tables) for each entry.

John W. Vinson [MVP]
 

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