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!

Delete or reset items from an entry form

Status
Not open for further replies.

trustsun

Technical User
Feb 4, 2004
73
US
Delete or reset items from an entry form


I have a simple questionnaire for users. How can I clear the entries without closing the form?
Currently I have a close button which saves the information to the table.
Here’s what I got;

rst![question3] = Me![opquestion3].Value
DoCmd.Close acForm, Me.Name

I used this to save and close the form. Instead of closing the form I just want to reset or clear the entries.
 
trustsun,

Create a new button (Refresh or Undo for example). On the Onclick event place something like this...

Code:
Private Sub btnRefresh_Click()
    
    Me!question1 = Null
    Me!question2 = Null
    Me!question3 = Null
    Me!question4 = 0    'Or whatever you need

End Sub

I hope this helps..

 
Almost!
I need to do both with one click.

Private Sub btnRefresh_Click()
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Mytable")
rst.AddNew
rst![question3] = Me![opquestion3].Value
Me!opquestion3 = Null


Keep getting object and do not support errors.
opquestion=form
question3table
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top