Hi Eddie1985
This, I'm sure, will not fix everything but I see one thing that's happening and causing MsgBox "DAMIT!!!!". This code is being triggered (inappropriately) when you click the Clear Button. Add the line of code as indicted.
'THIS CODE ONLY RUNS A FEW TIMES THEN GIVES AN ERROR'
Private Sub cboJobRef_Change()
If Flag = True Then Exit Sub '<------------ Add this line of Code
On Error GoTo errHandler:
Dim Rw As Long
With Me
Rw = Me.cboJobRef.ListIndex + 3
.txtSite.Value = ws.Cells(Rw, 1).Value
End With
Me.cboJobRef.List = ws.Range("JobNamDyn").Value
Exit Sub
errHandler:
MsgBox "DAMIT!!!!"
End Sub
Then in your Clear Button Code (at the bottom of the procedure) add these lines
Flag = True '<----------- Add this line of code
Me.cboJobRef.Value = ""
Flag = False '<----------- Add this line of code
Then in Module 1 add this line of code
Public Flag As Boolean '<----------- Add this line of code
Sub Picture3_Click()
UserForm1.Show vbModeless
End Sub
See if these changes help.
Bookmarks