ianohlander
Programmer
I have been creating a reservations db. I have two related tables, spaces and reservations, both with autonumber ids. The spaces table is related to the reservations table through the reservationID. I have a a parent form called AvailableSpaces, which has the reservationID, customerID and a combo box that selects the type of spaces the user wants. Then there is a subform that is linked to that combo box that displays all the available spaces of that type. The subform is setup so that when one of the spaces listed receives the focus, its spaceID is copied into a text box on the subform. All of that works fine. What I need to do is create a button that, when pressed, sets certain fields of the selected space record, specifically, the reservationID field held in the parent form, and the available field to false (so it doesn't show up in the available query the subform is based on.)
I was thinking along the lines of this:
Me![selectedID]![ReservationID] = Me![ReservationID]
except that the Me![selectedID] doesn't refer to the record in the space table. Neither does:
![Spaces]!Me![SelectedID]. How can I get a reference to that record so as to access its ReservationID field? This has got to be pretty basic to db programming, yet I can't find the answer anywhere. I know FindRecord only seems to work on records the form is based on, and my action is being done in the parent, which isn't based on the spaces table.
Help me, please. Thank you so much.
(PS: and how can I set up a total that will go through all the rooms in a reservation and add up the expenses so that they'll go on a billing sheet- if they have 1 res, sum one charge, 5 res, sum of 5 charges.)
Thank you.
Ian Ohlander
I was thinking along the lines of this:
Me![selectedID]![ReservationID] = Me![ReservationID]
except that the Me![selectedID] doesn't refer to the record in the space table. Neither does:
Help me, please. Thank you so much.
(PS: and how can I set up a total that will go through all the rooms in a reservation and add up the expenses so that they'll go on a billing sheet- if they have 1 res, sum one charge, 5 res, sum of 5 charges.)
Thank you.
Ian Ohlander