Sorry, I should have read closer. I added the additional code "<<<" and get "Compile Error: Next without For":
Private Sub lstLookup_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
On Error GoTo errHandler
'declare the variables
Dim ID As String
Dim I As Integer
Dim cNum As Long, X As Long
Dim findvalue As Range
'error block
On Error GoTo errHandler:
'get the select value from the listbox
For I = 0 To lstLookup.ListCount - 1
If lstLookup.Selected(I) = True Then
'set the listbox column
ID = lstLookup.List(I, 14)
If lstLookup.Selected(I) = False Then
Exit For
End If
Next I
If VBA.Len(ID) < 1 Then '<<<<
MsgBox "No data found"
Cancel = True '<<< Exit Sub '<<<<
End If
'find the value in the range
Set findvalue = Sheet2.Range("H:H").Find(What:=ID, LookIn:=xlValues).Offset(0, -6)
'add the values to the userform controls
cNum = 8
For X = 1 To cNum
Me.Controls("Reg" & X).Value = findvalue
Set findvalue = findvalue.Offset(0, 1)
Next
'disable the controls to make the user select an option
With Me
.cmdAdd.Enabled = False
.cmdAdd.BackColor = RGB(225, 225, 225)
.cmdEdit.Enabled = False
.cmdEdit.BackColor = RGB(225, 225, 225)
.cmdTraining.Enabled = False
.cmdTraining.BackColor = RGB(225, 225, 225)
.optAdd = False
.optEdit = False
.optTraining = False
End With
'error block
On Error GoTo 0
Exit Sub '<<<<
errHandler::
MsgBox "An Error has Occurred " & vbCrLf & "The error number is: " _
& Err.Number & vbCrLf & Err.Description & vbCrLf & _
"Please notify the administrator"
End Sub