Hi! I'm new to this forum and new to MS Access too, so please bear with me
This is what I have done so far:
I have a form that tracks registration and accommodation details of participants attending a conference.
I have two tables. One table contains a list of hotels, the number of rooms in each of them which is blocked for the participants, the number of rooms available per hotel (which should be updated as and when a participant books a room or two). The second table contains a column that has a lookup to the first one to get the names of the hotels, and another column to store the number of rooms booked by the participant.
I created a form based on the second table's data structure (as it contains a lot of other details other than just the lookup column) and the column which is the lookup is the source of a combo box in the form. In addition, I've made the number of available rooms from the first table, a second column as the source of the combo box, but display only the name of the hotel. I have a text box which is bound to the second (hidden column) of the combo box, to show the operator how many spare rooms are there in the selected hotel.
There is a small text box I have provided for the operator to enter how many rooms are needed to be booked.
So far so good?
What I want is this:
When the value is entered, and the record is saved, the number of spare rooms in the first table must be updated as the total number of rooms minus (-) the total number of rooms booked for that particular hotel, so that the next time, the text box bound to the combo box will show the new value.
How can I do this? I tried using a query, but to no avail. I tried progamming, but to little success. How can I do what I want to? I hope I have been clear in my very long question. Please help!