How to make a text box null

  • Thread starter Thread starter Lloyd
  • Start date Start date
L

Lloyd

I have added a delete button to my form, but prior to deleting, I display a
"reason" form for the user to put in the reason they want to delete a record,
which is then logged into a table. It works fine.

But if the user then wants to delete a second record, the "reason" form is
again displayed, but the previous reason is still in the text box (the text
box is unbound). How do I get the text box to come up null when it is
redisplayed so the previous reason is not still there?

thanks in advance.
 
Hi Lloyd,
Maybe your "reason" form is not closed after the first time you open it to
delete the first record, so it shows the last text typed in the control.
You can explicitly close the "reason" form before you open it. This will
clear any unbound controls.


If CurrentProject.AllForms("NameOfForm").IsLoaded Then
DoCmd.Close acForm, "NameOfForm"
End If

Docmd.OpenForm "NameOfForm"


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
That did it, thank you!

Jeanette Cunningham said:
Hi Lloyd,
Maybe your "reason" form is not closed after the first time you open it to
delete the first record, so it shows the last text typed in the control.
You can explicitly close the "reason" form before you open it. This will
clear any unbound controls.


If CurrentProject.AllForms("NameOfForm").IsLoaded Then
DoCmd.Close acForm, "NameOfForm"
End If

Docmd.OpenForm "NameOfForm"


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Back
Top