Clearing textbox upon opening Form

  • Thread starter Jacques Steinman
  • 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)
 
R

Ryan

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
 
J

Jacques Steinman

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top