Adding record to multiple tbls usin one form

  • Thread starter Ingrid L via AccessMonster.com
  • Start date
I

Ingrid L via AccessMonster.com

I need to make a form for adding record to multiple tables. I used table
relationship but I'm not getting it right I think.. plz can somebody help me
with the tbl structure and tbl relationship? Should I be making a query?


+ Reservations
guestID (autonumber)
roomID
category
datein
dateout

+ Guests
guestID (autonumber)
firstname
lastname

+ Rooms
roomID
category
 
A

Allen Browne

Your Rooms probably won't change very often, so the simplest interface would
be a main form bound to the Guests table, with a subform bound to the
Reservations table.

In this way, a guest can have multiple reservations over time.

In the subform, you can use a combo box to select the RoomID. The RowSource
for this combo will be the Rooms table.
 
R

Rick B

If your form includes a field from each table, then a record will be created
in each table.

In your example below, I can't see what you are trying to do. If you add a
new guest, it will create an entry in your guess table. You would not want
records added to your other tables at this time.

If you add a new roomId, you would not want records added to the other two
tables.

When you add a reservation, it will pull existing data from your other two
tables.
 
I

Ingrid L via AccessMonster.com

well, actually I wanted to make a reservation form (maybe using query too?)
that when I enter the guestID and roomID for eg, the fields in the other
tables will be automatically updated too.. but what do you suggest?


Rick said:
If your form includes a field from each table, then a record will be created
in each table.

In your example below, I can't see what you are trying to do. If you add a
new guest, it will create an entry in your guess table. You would not want
records added to your other tables at this time.

If you add a new roomId, you would not want records added to the other two
tables.

When you add a reservation, it will pull existing data from your other two
tables.
I need to make a form for adding record to multiple tables. I used table
relationship but I'm not getting it right I think.. plz can somebody help me
[quoted text clipped - 15 lines]
roomID
category
 
R

Rick B

If you are adding a reservation, wouldn't you already have the roomid built?
Haven't you already populated that table with all the possible rooms?

The guest should also be built before adding the reservation. You could
have a pop-up form tied to a button called "add new guest". The user would
click that and create the new guest only if the guest was a first-time
guest. Otherwise, they'd select the existing guest id.

You might look at the northwind database that comes with Access. Your
"guests" are similar to the customers. Your "reservations" are similar to
the orders, and your "Rooms" are similar to their products. I'd go look at
how Northwind handles selling a product to an existing customer and how you
can add a new one.

Hope that helps.

--
Rick B



Ingrid L via AccessMonster.com said:
well, actually I wanted to make a reservation form (maybe using query too?)
that when I enter the guestID and roomID for eg, the fields in the other
tables will be automatically updated too.. but what do you suggest?


Rick said:
If your form includes a field from each table, then a record will be created
in each table.

In your example below, I can't see what you are trying to do. If you add a
new guest, it will create an entry in your guess table. You would not want
records added to your other tables at this time.

If you add a new roomId, you would not want records added to the other two
tables.

When you add a reservation, it will pull existing data from your other two
tables.
I need to make a form for adding record to multiple tables. I used table
relationship but I'm not getting it right I think.. plz can somebody
help me
[quoted text clipped - 15 lines]
roomID
category
 
I

Ingrid L via AccessMonster.com

I have taken a look at the northwind database but still can't get it to work..
what table structure & relationship should I be using??

Rick said:
If you are adding a reservation, wouldn't you already have the roomid built?
Haven't you already populated that table with all the possible rooms?

The guest should also be built before adding the reservation. You could
have a pop-up form tied to a button called "add new guest". The user would
click that and create the new guest only if the guest was a first-time
guest. Otherwise, they'd select the existing guest id.

You might look at the northwind database that comes with Access. Your
"guests" are similar to the customers. Your "reservations" are similar to
the orders, and your "Rooms" are similar to their products. I'd go look at
how Northwind handles selling a product to an existing customer and how you
can add a new one.

Hope that helps.
well, actually I wanted to make a reservation form (maybe using query too?)
that when I enter the guestID and roomID for eg, the fields in the other
[quoted text clipped - 20 lines]
 

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