Question : Clear Fields from Bound Form

I have a form with 4 fields that are all bound. How do I simply clear the fields once it is saved or when i click the Cancel button. The field names are  
strEmpName  = TextBox
strEmpPassword = TextBox
title = combobox
site = combobox

Answer : Clear Fields from Bound Form

Ok ...


Private Sub cmdSave_Click()
   
    Dim resp
    resp = MsgBox("Are you sure you want to save the record?", vbYesNo + vbQuestion, "Save Changes")
    If resp = vbYes Then
    ' do nothing
    Else
    Cancel = True  ' cancels the update
        Exit Sub  '  **************  add this also
    End If
   
    ' DoCmd.RunCommand acCmdSaveRecord  
    Me.Dirty = False    ' save the record - use this instead
    Docmd.GoToRecord ,,acNewRec          ' go to a new record
             
  '  DoCmd.Close    ' Why would you close the form - if you want to clear the fields ??
   
End Sub
Random Solutions  
 
programming4us programming4us