Hello All,
I know this isnt a VB Forum but this is home so I will ask here first... Creating a user form, and I am still new to VB, here is my code;
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdClearForm_Click()
Call UserForm_Initialize
End Sub
Private Sub cmdSubmit_Click()
ActiveWorkbook.Sheets("Credit Data Form"
.Activate
Range("A1"
.Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtClientID.Value
ActiveCell.Offset(0, 1) = txtName.Value
ActiveCell.Offset(0, 2) = txtAmount.Value
ActiveCell.Offset(0, 3) = txtDate.Value
ActiveCell.Offset(0, 4) = cdoAgentName.Value
ActiveCell.Offset(0, 5) = cboPer.Value
ActiveCell.Offset(0, 6) = txtNotes.Value
End If
Range("a1"
.Select
End Sub
Private Sub UserForm_Initialize()
txtClientID.Value = ""
txtName.Value = ""
txtAmount.Value = ""
txtDat.Value = ""
With cboAgentName
.AddItem "Cory"
.AddItem "Crystal"
.AddItem "Jesse"
.AddItem "Arion"
.AddItem "Trisha"
.AddItem "Nate"
.AddItem "Mark"
.AddItem "N/A"
End With
With cboPer
.AddItem "Michael"
.AddItem "Luis"
.AddItem "Ritchie"
End With
txtNotes.Value = ""
txtClientID.SetFocus
End Sub
I keep getting "Run Time Error 424 Object Required" when I try and run this. Im using Office 2002 SP2 on Windows XP Pro. Does anyone know where I am going wrong? As always any help is much appreciated.
Thanks,
Wray
I know this isnt a VB Forum but this is home so I will ask here first... Creating a user form, and I am still new to VB, here is my code;
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdClearForm_Click()
Call UserForm_Initialize
End Sub
Private Sub cmdSubmit_Click()
ActiveWorkbook.Sheets("Credit Data Form"
Range("A1"
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = txtClientID.Value
ActiveCell.Offset(0, 1) = txtName.Value
ActiveCell.Offset(0, 2) = txtAmount.Value
ActiveCell.Offset(0, 3) = txtDate.Value
ActiveCell.Offset(0, 4) = cdoAgentName.Value
ActiveCell.Offset(0, 5) = cboPer.Value
ActiveCell.Offset(0, 6) = txtNotes.Value
End If
Range("a1"
End Sub
Private Sub UserForm_Initialize()
txtClientID.Value = ""
txtName.Value = ""
txtAmount.Value = ""
txtDat.Value = ""
With cboAgentName
.AddItem "Cory"
.AddItem "Crystal"
.AddItem "Jesse"
.AddItem "Arion"
.AddItem "Trisha"
.AddItem "Nate"
.AddItem "Mark"
.AddItem "N/A"
End With
With cboPer
.AddItem "Michael"
.AddItem "Luis"
.AddItem "Ritchie"
End With
txtNotes.Value = ""
txtClientID.SetFocus
End Sub
I keep getting "Run Time Error 424 Object Required" when I try and run this. Im using Office 2002 SP2 on Windows XP Pro. Does anyone know where I am going wrong? As always any help is much appreciated.
Thanks,
Wray