I have a vba userform in a workbook that I obviously want to add data to a worksheet with in the document.
When the submit button is clicked - an error message appears which reads:
Compile error cannot find project or library.
Im afraid the workbook file is too big to upload but here is my code which im hoping the error is in. The red text is what the debugger highlights when the error is displayed.
Private Sub chkbranch_Click()
If true value = "B"
End Sub
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Worklog")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a repit code number
If Trim(Me.txtref.Value) = "" Then
Me.txtref.SetFocus
MsgBox "Please enter a Repit Code"
Exit Sub
End If
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.txtref.Value
ws.Cells(iRow, 2).Value = DateValue(txtdate.Value)
ws.Cells(iRow, 3).Value = Me.txtbranch.Value
ws.Cells(iRow, 4).Value = Me.txtproperty.Value
ws.Cells(iRow, 5).Value = Me.lststatus.Value
ws.Cells(iRow, 6).Value = Me.lstaction.Value
ws.Cells(iRow, 8).Value = DateValue(txtchase.Value)
ws.Cells(iRow, 9).Value = Me.txtinitial.Value
ws.Cells(iRow, 10).Value = Me.txtcomment.Value
'clear the data
Me.txtref.Value = ""
Me.txtdate.Value = ""
Me.txtbranch.Value = ""
Me.txtproperty.Value = ""
Me.lststatus.Value = ""
Me.lstaction.Value = ""
Me.txtchase.Value = ""
Me.txtinitial.Value = ""
Me.txtcomment.Value = ""
Me.txtref.SetFocus
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub Label5_Click()
End Sub
Private Sub txtactionyes_Click()
End Sub
Private Sub lstaction_Change()
End Sub
Private Sub lststatus_Click()
End Sub
Private Sub txtbranch_Click()
End Sub
Private Sub txtchase_Change()
End Sub
Private Sub txtdate_Change()
End Sub
Private Sub txtref_Change()
End Sub
Private Sub UserForm_Click()
End Sub
Bookmarks