Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I have a userform (uf1_assess_sched) with a listbox (uf1_listbox3).
When the user selects an item in uf1_listbox3, a second userform (group_1) is opened.
The user has a commandbutton (exit1) he may push to exit group_1. Upon exiting group_1, the user may once again select a value from uf1_listbox3 to continue the process again.
However, after the user exits from group_1 (see code below), and uf1_assess_sched returns to focus, none of the controls (listboxes) on that userform appear to trigger. ie, if the user selects an item in uf1_listbox3 nothing happens. The uf1_listbox3 click event (see code below) is not executed. Please help to regain this functionality.
uf1_listbox3 CLICK event ... opens up userform group_1 once an iten in uf1_listbox3 has been selected
From userform_1, the user is returned to uf1_assess_sched having pushed the exit (exit1) button
I would be very grateful for any assistance in diagnosing and resolving this problem.
When the user selects an item in uf1_listbox3, a second userform (group_1) is opened.
The user has a commandbutton (exit1) he may push to exit group_1. Upon exiting group_1, the user may once again select a value from uf1_listbox3 to continue the process again.
However, after the user exits from group_1 (see code below), and uf1_assess_sched returns to focus, none of the controls (listboxes) on that userform appear to trigger. ie, if the user selects an item in uf1_listbox3 nothing happens. The uf1_listbox3 click event (see code below) is not executed. Please help to regain this functionality.
uf1_listbox3 CLICK event ... opens up userform group_1 once an iten in uf1_listbox3 has been selected
Code:
Private Sub uf1_listbox3_Click()
If mbEvents Then Exit Sub
MsgBox Me.uf1_listbox3.Value
group_1.Show
End Sub
From userform_1, the user is returned to uf1_assess_sched having pushed the exit (exit1) button
Code:
Private Sub exit1_Click()
Dim ui2 As VbMsgBoxResult
Dim lastrow As Long
If ws_vh.Range("E2") > 0 Then 'unsaved info
Me.Label34.Caption = " Saving unsaved rental data."
Me.Label34.BorderColor = RGB(50, 205, 50)
lastrow = ws_rd.Cells(ws_rd.Rows.Count, "A").End(xlUp).Row
ws_rd.Range("A3:FZ" & lastrow).Sort key1:=ws_rd.Range("A3"), order1:=xlAscending, Header:=xlNo
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Unload group_1
End
End If
If ws_vh.Range("B2") > 0 Then 'Outstanding rentals?
ui2 = MsgBox("You still have " & ws_vh.Range("C2") & " rentals with critical missing rental information." & Chr(13) & Chr(13) _
& "Active (Sports) rentals: " & ws_vh.Range("B3") & Chr(13) & "Passive (Picnics) rentals: " & ws_vh.Range("B4") & Chr(13) & Chr(13) _
& "Are you sure you wish to exit?", vbInformation + vbYesNo, "OUTSTANDING RENTAL INFORMATION")
If ui2 = vbYes Then
If ws_vh.Range("N4") > 0 Then
Me.Label34.Caption = " Saving unsaved rental data."
Me.Label34.BorderColor = RGB(50, 205, 50)
lastrow = ws_rd.Cells(ws_rd.Rows.Count, "A").End(xlUp).Row
ws_rd.Range("A3:FZ" & lastrow).Sort key1:=ws_rd.Range("A3"), order1:=xlAscending, Header:=xlNo
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Unload group_1
With uf1_assess_sched
.uf1_listbox3.ListIndex = -1
End With
Exit Sub
Else
Unload Me
End
End If
Else
Exit Sub
End If
End If
Unload group_1
End
End Sub
I would be very grateful for any assistance in diagnosing and resolving this problem.