I am creating a reservation system. I have a table called schedule which list all the available dates and how many products are available for each date, products are passengers, boats, canoes, kayaks, bikes.
I have second table ResTrip that contains the actually reservations for each date and which products. I create the reservation using a form (subform actually). When I add it to the table using a macro which run an UPDATE query that is suppose to subtract 1 from the number of spaces available in the Schedule table.
For some reason the query is not getting the two piece of information from the form, (salidate and product) to use as criteria for the query and ends up updating a bunch of unrelated records. If i run the query standalone and manually enter the parameters it works fine.
I am not sure if I can do this from a macro or from VBA, or am I not setting my criteria correctly? I am still new
Here are the different items
form
Actual field names
ResTrip table
Schedule table
Update Query
UPDATE schedule SET schedule.AvaiIable = [schedule]![AvaiIable]-1
WHERE (((schedule.Sailing_Date)=[Forms]![ResTrip_subform]![SailDate]) AND ((schedule.product)=[Forms]![ResTrip_subform]![Product]));
ADD Marco