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

Auto - Update a record in a second table?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi - what I want to do is this. I have two tables, lets call them names and numbers.In each table, I have a primary key (named "id") defined that is just an autonumber.In the names table I also have a name field and in the numbers table I have a number field.
NAMES
id (KEY)
name
NUMBERS
id (KEY)
number
I want to be able to enter a new name in the NAMES table, and be given the id number through the auto number.Then have a new record created in the NUMBERS table for that auto-number that was given. In other words, when you enter "John" for name in the NAMES table, I would like to see this:

NAMES
1 (from autonumber)
John

NUMBERS
1
0 (default)

I read about relationships between tables, but it didnt seem to help. I'm sure I could do something with the VB code, but I thought it might be easier this way.

I realize that with such small tables, they should be just one table with 3 fields. I have a more complicated setup, but used this example for simplicity's sake.
Thanks for your suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top