Add data to two tables from one form

G

Guest

I have two tables:

MOVIES
mid
title
director

DIRECTOR
did
name

Director in the movies table has a one-to-many relation to the director
table.

What I want to do is this:

I want a form where I can add director to the movies from a combo-box (this
is easy, and not a problem) BUT I also want a field where I can add new
directors to the director table if the name is already registred. How do I
solve this?
 
F

fredg

See my comments in line below.

I have two tables:

MOVIES
mid
title
director

DIRECTOR
did
name

Director in the movies table has a one-to-many relation to the director
table.

Isn't the above backwards? The Director table should have a
one-to-many relationship to the Movies table.
One director can have many movies, but a movie has only one director.
What I want to do is this:

I want a form where I can add director to the movies from a combo-box (this
is easy, and not a problem) BUT I also want a field where I can add new
directors to the director table if the name is already registred. How do I
solve this?

What do you mean by 'already registered'?
Do you mean the directors name is already in the Movies table? That is
not the way to do this.
A director should not be in the Movies table unless he is already
first listed in the Director table.

You can either first enter new directors into the Director table, then
use a combo box to enter the director's name (DirectorID) into the
Movies table,
OR...
When entering a new director (not already in the Director table) into
the Movies table using a Combo Box, use the Combo box NotInList event
to add the new director to the Director table. How would depend upon
what other information you are saving about the director in the
Director's table.

You can give
http://www.groups.google.com
a quick search on the "NotInList" event and return several different
methods to add to the Director table.
 

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