I have a form whereby I can add an event. I choose a date and discipline and save button and thats the event. It also adds this event to a listbox on the same form so you can see the events that have been added. The adding works and all is fine.
The issue I am having is deleting an event by selecting a value from the listbox. I cant seem to return any value that I have selected and even putting a messagebox in to see the values, returns null each time so I can populate the variable to put int the SQL code to match the record to delete.
Ive searched the site with a couple of solutions but none seem to resolve the problem I am having.
You can see here im trying all sorts just to get the value selected from the list box:
Code:
Public Sub lstShoot_Click()
Dim lstShootValue As String
Dim varItem As Variant
Dim ctl As Control
Set ctl = Me.lstShoot
'lstShootValue = Me.lstShoot.ItemData(0)
'lstShootValue = Me![lstShoot].Column(0)
lstShootValue = CStr(ctl.ItemData(varItem))
MsgBox ("Value = " & lsShootValue)
End Sub
Whats going on here? It shouldn't be this difficult.