Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cmd button - Clear fields and don't save in table 1

Status
Not open for further replies.

gRegulator

Technical User
Jul 3, 2003
133
CA
Hi everyone,

I have a data entry form on which I have placed a cmd button to clear all fields. However, when this happens, the blank fields are saved in my table to which the form is bound. My code is pretty basic and reads:

Private Sub Command109_Click()

Me.Last_Name = ""
Me.Given_Names = ""
Me.Male = ""
Me.Female = ""
Me.cboBirthDate = ""
Me.ocxCalendar.Visible = False

End Sub

I am trying to figure out how to manipulate this code do that when the form is cleared and exited, the blank fields are not saved in my table. Any suggestions?

Thanks everyone!
 
Hi, gRegulator,

Code:
If Me.Dirty Then
    Me.Undo
End If
HTH,

Ken S.
 
Eupher,

Thanks so much for the tip! Worked like a charm :)

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top