Av8tordude
Well-known Member
- Joined
- Oct 13, 2007
- Messages
- 1,075
- Office Version
- 2019
- Platform
- Windows
i'm using the code below to delete the value in a combo box, which will trigger the code in the combo box. Sometimes it works and sometimes it doesn't, but I can't determine what causing it not to trigger the change event. From my understanding, since I'm deleting the value from the combo box, that should trigger a change event. Can someone offer some insight as to why its not working? BTW, I did debug through the code, I can see the value being deleted, but the change event does not trigger.
When I click enter command buttong, cbName = "" is suppose to delete the value in the combo box....
when the value is delete, the code below (which is in the change event) is suppose to trigger..
When I click enter command buttong, cbName = "" is suppose to delete the value in the combo box....
VBA Code:
If ActiveCell = vbNullString Then
If obStock = True Then cbName = "" Else NewEntry
Else
LogForm = True: Call Records
End If
when the value is delete, the code below (which is in the change event) is suppose to trigger..
VBA Code:
Private Sub cbName_Change()
Dim Result As Variant
Dim LRow As Long
cbName = UCase(cbName)
cbEnter.Enabled = Not Trim(cbName) = ""
LRow = Application.Max(7, Range("A" & Rows.Count).End(xlUp).Row)
Result = Application.VLookup(cbName, Range("A7:B" & LRow), 2, False)
clbinternet.Visible = IsConnected = False
clbScaleIO.Visible = Trim(cbName) > "" And cbT1.ListIndex < 2
clbSpread.Visible = Trim(cbName) > "" And cbT1.ListIndex = 2
If Trim(cbName) = "" Then
NewEntry
Else