I finally got my add item feature going.
I have a list of bookings for both January and February. Just for reference, 'BoI' is the name of the field which I want to add or remove.
My code looks like this:
If Month(Me.Date_1) = 1 Then
ListJ.AddItem Me.BoI
ElseIf Month(Me.Date_1) = 2 Then
ListF.AddItem Me.BoI
EndIf
That all works fine. By the way, ListJ is for January and ListF is for February. However, when I want to remove a booking, is there any way I can click the BoI on the listbox and make a button which removes it from the listbox and clears all its fields? For example...
Say '121205/M' is in ListJ...
Can I make a button ('Cancel Booking') so when I click on that value (so it's highlighted) it removes it from the list and clears all the fields. So the fields become "" (empty). E.g., Name: Bob Smith | When you click the 'Cancel Booking' button it removes '121205/M' from ListJ and Name.Caption = "" (plus the other fields become empty). Is this possible? I know this is a lot of reading so I deeply appreciate your help. Thanks guys - hope you had a good Easter.
I have a list of bookings for both January and February. Just for reference, 'BoI' is the name of the field which I want to add or remove.
My code looks like this:
If Month(Me.Date_1) = 1 Then
ListJ.AddItem Me.BoI
ElseIf Month(Me.Date_1) = 2 Then
ListF.AddItem Me.BoI
EndIf
That all works fine. By the way, ListJ is for January and ListF is for February. However, when I want to remove a booking, is there any way I can click the BoI on the listbox and make a button which removes it from the listbox and clears all its fields? For example...
Say '121205/M' is in ListJ...
Can I make a button ('Cancel Booking') so when I click on that value (so it's highlighted) it removes it from the list and clears all the fields. So the fields become "" (empty). E.g., Name: Bob Smith | When you click the 'Cancel Booking' button it removes '121205/M' from ListJ and Name.Caption = "" (plus the other fields become empty). Is this possible? I know this is a lot of reading so I deeply appreciate your help. Thanks guys - hope you had a good Easter.