How to make a text box null

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.
 
J

Jeanette Cunningham

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
 
L

Lloyd

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
 

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