Clearing textbox upon opening Form

  • Thread starter Thread starter Jacques Steinman
  • Start date Start date
J

Jacques Steinman

Hi All

Basically the topic says it all. What do I need to code to make sure the
textbox doesn't recall a previously entered record? (the record was saved to
a table)
 
Well, if the textbox is on a form and you want to save the values, but dont
want an old value to show up, then you would change the on click event of
whatever opens the form. Say you have a button on a form that opens the
form, the on click event would look like this.

Private Sub OpenYourForm_Click()
DoCmd.OpenForm "YourFormName", , , , acFormAdd

The acFormAdd goes to a new record.

You could also have a simple command in the On Open event of the form.

Private Sub Form_Open()
Me.TextBoxName = ""
Or
Private Sub Form_Open()
Me.TextBoxName = Null
 
Thanks. That Helped

Ryan said:
Well, if the textbox is on a form and you want to save the values, but dont
want an old value to show up, then you would change the on click event of
whatever opens the form. Say you have a button on a form that opens the
form, the on click event would look like this.

Private Sub OpenYourForm_Click()
DoCmd.OpenForm "YourFormName", , , , acFormAdd

The acFormAdd goes to a new record.

You could also have a simple command in the On Open event of the form.

Private Sub Form_Open()
Me.TextBoxName = ""
Or
Private Sub Form_Open()
Me.TextBoxName = Null
 
Back
Top