Thank you all for your time.
I have database for housekeeping for hotel.
Main table: tbl_hkeeping_Mast
child table: Tbl_hkeeping_Detail in datasheet view
in a subform, I have room_no as combobox, which gets records from Tbl_Room_Mast. How do i exclude rooms that have already been selected in subform while entering data.
I tried rowsource property in on got focus and everywhere else. but its showing an error-syntex error or operator missing.
Then I tried it in service field after update event. It excluded first selected room in second row but that first selected room number came back in third row combobox values.
BTW roon_no is number field.
Me.HK_ROOM_NO.RowSource = "SELECT room_No from tbl_room_mast " & _
"Where room_no <> " & Me.HK_ROOM_NO & ";"
I see one solution as a code loop thorough the records in the subform to create a string variable consisting of a comma delimited list of the values. But my VBA knowledge is very limited. I tried searching online but it's confusing.
thanks in advance.