Open form filtering on sub-subform criteria
Posted on 2004-11-24
I have a form(f_bookinghead primarykey "BookingGroupID") that has a subform(f_bookingheadform primarykey "BookingHeadID") and the subform has a subform(f_bookingdetail primarykey "BookingDetailID").
The way my form is set up I can't use record selectors effectively. This makes things difficult for when someone wants to edit data after they have moved onto a new record. For this situation the BookingGroupID won't be changing at all. What I want to be able to do is navigate to a record based on the BookingHeadID and BookingDetailID.
I have set up a command button called "EditBooking". It pops up a form "f_EditBooking" that displays all of the records for the particular BookingGroupID in a listbox "lstEditBooking". What I would like to do is on the double click event of lstEditBooking, display the infomation based on the BookingDetailID (lstEditbooking.column(6)) and BookingHeadID (lstEditBooking.column(13)).
What I have tried is to set a variable "bdid" to lsteditbooking.column(6) and another variable "bhid" to lsteditbooking.column(13), then filtering each form to those specific variables. To be honest, this may be the right approach but I was just going about it wrong. I don't know...or I tried closing the form and opening it based on the criteria. I wasn't successful in either attempt, but I also wasn't very confident in what I was doing.
Any suggestions would be terrifically appreciated. I'll try whatever you guys/gals think of.