Hi Vlad, so i have added the following to my module called Public Functions
Code:
Option Compare DatabaseOption Explicit
Public Function ClearList(lst As ListBox) As Boolean
Dim varItem
If lst.MultiSelect = 0 Then
lst = Null
Else
For Each varItem In lst.ItemsSelected
lst.Selected(varItem) = False
Next
End If
End Function
I have added the following to the last procedure my list on Click event
The full event is quite large but basically the list is set a table/Query from tblMainList with 2 fields
field 1 is RecordNo set to Number field 2 is ListItems
lstMainList column(0) (record No) is set to zero width and column(1) is set to display (ListData)
Then using select case Me.lstMainList.Column(0)
Case 1
Open Form
Case 2
Send Email
etc etc..
unsure if it makes a difference that the list source is table.query and not value list ?
anyhow this is the last part of code as full procedure is large
Code:
Case 5
DoCmd.OpenForm "frmStorage"
Case 6
DoCmd.OpenForm "frmSearch"
If Not IsNull(Forms!frmMainMenu!frmIndex1!cboCustomer) Then
strCust = Forms!frmMainMenu!frmIndex1!cboCustomer
Else
strCust = DLookup("Name", "tblCustomers", "[RecordNo] = 98")
End If
Forms!frmSearch!txtCustomer = strCust
End Select
ClearList (Me.lstMainOptions)
End Sub