Just add some more lines before the end of your sub:
txtAddress.value = ""
txtSuburb.value = ""
...
cboThird.value = ""
But sometimes users want to keep the values for the next entry.
You may want something like:
Private Sub cmdOK_Click()
Dim Resp as long '<--added
Sheets("Band Members").Select
Range("Last_Name").Select
Selection.EntireRow.Insert
ActiveCell.Value = txtName.Text
ActiveCell.Offset(0, 1).Value = txtAddress.Text
ActiveCell.Offset(0, 2).Value = txtSuburb.Text
ActiveCell.Offset(0, 3).Value = txtPhone.Text
ActiveCell.Offset(0, 4).Value = cboType.Text
ActiveCell.Offset(0, 5).Value = "A"
ActiveCell.Offset(0, 6).Formula _
= "=IF(Status = ""A"",VLOOKUP(Type,Fees_table,2),0)"
ActiveCell.Offset(0, 8).Value = cboMain.Text
ActiveCell.Offset(0, 9).Value = cboSecond.Text
ActiveCell.Offset(0, 10).Value = cboThird.Text
resp = msgbox("Prompt:="Clear the values?", buttons:=vbyesno)
if resp = vbyes then
txtAddress.value = ""
txtSuburb.value = ""
'...
cboThird.value = ""
end if
End Sub
You could even choose to keep some existing values and clear the ones that
shouldn't be duplicated.
Pam Field wrote:
--
Dave Peterson
|