ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,731
- Office Version
- 2007
- Platform
- Windows
I am using the code below.
I make a selection from my ComboBox which then populates the Listbox.
Normally when i then make a Listbox select i would say YES to the Msgbox that has just popped up.
Occioanly the user would be selecting NO of which the closes the Msgbox.
Now at this point the Listbox selection is still in a select state / blue in color,see screenshot
Please advise what code i need to add so when the MsgBox is closed the Listbox value isnt selected.
I did try this but nothing happed,so i assume its wrong
Thanks
I make a selection from my ComboBox which then populates the Listbox.
Normally when i then make a Listbox select i would say YES to the Msgbox that has just popped up.
Occioanly the user would be selecting NO of which the closes the Msgbox.
Now at this point the Listbox selection is still in a select state / blue in color,see screenshot
Please advise what code i need to add so when the MsgBox is closed the Listbox value isnt selected.
I did try this but nothing happed,so i assume its wrong
Rich (BB code):
ListBox1.Selected(ListBox1.ListIndex) = False
Rich (BB code):
Private Sub ListBox1_Click()
Dim rw As Long
Dim answer As VbMsgBoxResult
With Me.ListBox1
'get database row number
rw = Val(.Column(.ColumnCount - 1, .ListIndex))
If rw = 0 Then Exit Sub
End With
With wsDatabase
.Activate
.Range("A" & rw).Select
End With
answer = MsgBox("OPEN CUSTOMERS FILE IN MAIN DATABASE ?", vbYesNo + vbInformation, "OPEN Database MESSAGE")
If answer = vbYes Then
Unload ProgrammerForm
Database.LoadData Sheets("DATABASE"), Selection.Row
Else
End If
End Sub