I am VERY new VBA programmer so I need some help. Below is my code. I cannot seem to get the items to add to my listbox. Below is what I found as code online as examples, but it doesn't seem to work. There are probably other problems as well, so if anyone has any suggestions, please, fire away!
Private Sub UserForm_initialize()
nameto.Clear
nameby.Clear
asset.Clear
insttype.Clear
dateerror.Clear
doctype.Clear
comments.Clear
With errorlistbox
.AddItem "Footnotes"
.AddItem "Writeover"
.AddItem "Missing Signature"
.AddItem "Incorrect/No Date"
.AddItem "Blanks on Page"
End With
End Sub
Private Sub submit_Click()
ActiveWorkbook.Sheets("Sheet2").Activate
Range("A2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = nameto.Value
ActiveCell.Offset(0, 1) = nameby.Value
ActiveCell.Offset(0, 2) = asset.Value
ActiveCell.Offset(0, 3) = insttype.Value
ActiveCell.Offset(0, 4) = dateerror.Value
ActiveCell.Offset(0, 5) = doctype.Value
ActiveCell.Offset(0, 6) = errorlistbox.Value
Range("A2").Select
DoCmd.Close acForm, "UserForm"
End Sub
It also may help to know that I am getting 'Runtime Error 424 Object Required' when I run the code.
Bookmarks