printing selected recordset from a subform

  • Thread starter Makai from Denmark
  • Start date
M

Makai from Denmark

This is my situation, I have a form for example "event form" that load Event
Seat as a subform and a command that open another form as a Dialog form. On
this form I use label to represent the fields of the event seats. On this
form I have a public sub called Holdseat that takes LabelName as value. Each
labelname on this graphic form has private sub.

Finally, I have another Command called "Reserve seat" that changes the
colour of the label from blue to red and changes the subform value from
"available" to "Sold".

My Problem is this: How can I rewrite this code displayed below to print the
labelname fields selected "sold" on the Event subform?
--
Dim MyDB As DAO.Database
Dim RS As DAO.Recordset
Set MyDB = CurrentDb
Set RS = MyDB.OpenRecordset("SELECT EventSeats.EventSeatID, " _
& "SettingSeats.FormLabel " _
& "FROM EventSeats INNER JOIN SettingSeats ON " _
& " EventSeats.Seat = SettingSeats.SeatName " _
& "Where EventSeats.EventID = " & Me.OpenArgs, dbOpenSnapshot)
Do Until RS.EOF
If Me.Controls(RS("FormLabel")).BackColor = 16711680 Then
MyDB.Execute "Update EventSeats set Status = ""Sold"" " _
& "Where EventSeatID = " & RS("EventSeatID")
End If
RS.MoveNext
Loop
DoCmd.Close
 
Top