>After 2 months of experimenting and bothering you all with my questions, I am
>starting my database project all over again. The small backpackers hostel in
[quoted text clipped - 7 lines]
>problem is that I am doing this all, using the Spanish language version of
>Access, and Spanish is not my first language!)
Buen suerte!
>This is my plan.
>
[quoted text clipped - 8 lines]
>StayID, unique, access assigned autonumber, primary key
>GuestID, unique access assigned, foreign key
This should almost surely NOT be unique - unless you want to either
prevent repeat visits, or require you to enter the same guest
information twice. GuestID should be a NONunique foreign key I'd
guess.
>StayArrivalDate
>StayDepartureDate
>PriceFields (calculated fields like pricepernight X numberofnights and
>touristtax etc.)
This *might* be one of the cases where you actually want to store
calculated data (since you're capturing the price as of the time of
the visit, and that price might change in the future).
>More fields that only apply to the actual stay. This is very confusing to
>me and is posing me problems because of my conceptions. See below for a list
[quoted text clipped - 13 lines]
>circles)
>Does every guest have a stay and every stay has an assigned room?
Every guest would have one *or more* stays, I'd presume (again, don't
exclude repeat business unnecessarily!) A Stay has an assigned room,
but the Guests table should not; a guest might request a room change,
or (again) come back on another trip because they liked the place so
well.
>Or does every guest have a room and every room has a stay?
Every room would presumably have MANY stays, over time.
>Once I understand the answer to that basic question, then I think I will be
>more confident of the next issues:
>Each guest can have many stays say in the course of a year, thus the need
>for unique stayIDs. Each room can have more than one guest in a given stay,
[quoted text clipped - 6 lines]
>
>Is my confusion making any sense to anyone?
I think you need one more table, since there is in fact a many to many
relationship between Guests and Stays: RoomOccupancy maybe, with
fields for StayID and GuestID.
John W. Vinson[MVP]
andreainpanama - 02 Aug 2006 02:07 GMT
Can you clarify what you mean by this comment? Are you referring to the
GuestID in my stay table?
"This should almost surely NOT be unique - unless you want to either prevent
repeat visits, or require you to enter the same guest information twice.
GuestID should be a NON unique foreign key I'd guess."
My thinking was that somehow my guest table would pick up the GuestID from
my Guest Table, so I wouldn't have to reenter the guestinfo.
> >After 2 months of experimenting and bothering you all with my questions, I am
> >starting my database project all over again. The small backpackers hostel in
[quoted text clipped - 79 lines]
>
> John W. Vinson[MVP]
John Vinson - 02 Aug 2006 03:39 GMT
>Can you clarify what you mean by this comment? Are you referring to the
>GuestID in my stay table?
Yes.
>"This should almost surely NOT be unique - unless you want to either prevent
>repeat visits, or require you to enter the same guest information twice.
>GuestID should be a NON unique foreign key I'd guess."
>
>My thinking was that somehow my guest table would pick up the GuestID from
>my Guest Table, so I wouldn't have to reenter the guestinfo.
Typically you would use a Form based on the Guest table (or, perhaps,
if it works better for you on the Rooms table) with a Subform based on
the Stay table. You'ld insert the guestID using the Master/Child link
field in the first case, or with a Combo Box in the second.
My point was the *UNIQUE* character of the GuestID field. While that
field should be unique in the Guests table, it should be non-unique in
the Stays table (or the resolver table that I suggested later on).
John W. Vinson[MVP]