Apologies guys but this is my first attempt at VBA and I cannot fix this error. I keep getting error - Compile Error - Method or Data Member Not Found. Can anyone help me out please?
Private Sub cboProblemCategory_DropButtonClick()
Me.cboProblemCategory.AddItem "Tooling"
Me.cboProblemCategory.AddItem "Design"
Me.cboProblemCategory.AddItem "Operator"
Me.cboProblemCategory.AddItem "Documentation"
Me.cboProblemCategory.AddItem "Missing Part"
Me.cboProblemCategory.AddItem "Damaged Part"
End Sub
Private Sub cboSeverity_DropButtonClick()
'Populate control.
Me.cboSeverity.AddItem "High"
Me.cboSeverity.AddItem "Medium"
Me.cboSeverity.AddItem "Low"
End Sub
Private Sub cmdAdd_Click()
'Copy input values to sheet.
Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("NCR Form")
1 Row = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(lRow, 1).Value = Me.txtdate.Value
.Cells(lRow, 2).Value = Me.txtJobNumber.Value
.Cells(lRow, 3).Value = Me.txtRaisedBy.Value
.Cells(lRow, 4).Value = Me.txtProjectManager.Value
.Cells(lRow, 5).Value = Me.cboSeverity.Value
.Cells(lRow, 6).Value = Me.txtCause.Value
.Cells(lRow, 7).Value = Me.txtCorrectiveAction.Value
.Cells(lRow, 8).Value = Me.txtPreventativeAction.Value
.Cells(lRow, 9).Value = Me.txtTimeTakenMins.Value
.Cells(lRow, 10).Value = Me.txtMaterialCost.Value
.Cells(lRow, 11).Value = Me.txtTimeToReInspectMins.Value
.Cells(lRow, 12).Value = Me.cboProblemCategory.Value
.Cells(lRow, 13).Value = Me.txtTotalTime.Value
.Cells(lRow, 14).Value = Me.obClosed.Value
End With
'Clear input controls.
Me.txtdate.Value = ""
Me.txtJobNumber.Value = ""
Me.txtRaisedBy.Value = ""
Me.txtProjectManager.Value = ""
Me.cboSeverity.Value = ""
Me.txtCause.Value = ""
Me.txtCorrectiveAction.Value = ""
Me.txtPreventativeAction.Value = ""
Me.txtTimeTakenMins.Value = ""
Me.txtMaterialCost.Value = ""
Me.txtTimeToReInspectMins.Value = ""
Me.cboProblemCategory.Value = ""
Me.txtTotalTime.Value = ""
Me.obClosed.Value = ""
End Sub
Private Sub cmdClose_Click()
'Close UserForm.
Unload Me
End Sub
I also don't know how to add the Field Names to the Userform - can anyone also guide me with this?
Command Button 1 is Save
Thanks Guys.
Bookmarks