How to clear the previous data

T

Tim

I create a new form with properties Data Entry, Allow Additions/Delete/Edits
= Yes. I creat some combo boxes to capture the data and to show them to the
users on text boxes (so users don't have to type in). These data are just
for the showing purpose, they are not stored into the database.

When I advance to the next record, these data are still there even though I
created a button with the GotoNextRecord command. Can you pls show me how to
clear up these data so when the users go to the new record, all fields on the
form are cleared up ready for new data? Thanks for your help in advance.
 
B

BruceM via AccessMonster.com

I'm not sure I quite understand the situation, but if you enter data into an
unbound control it will remain there until you change the data or close the
form, unless you explicitly clear it.

To do that you could use the form's Current event:

Me.Combo1 = Null
Me.Combo2 = Null

Null should work, but it may be that you need to use a zero-length string
(depending on how things are set up in your project):

Me.Combo1 = ""

As a point of terminology, fields are where data are stored in tables.
Controls are text boxes, combo boxes, labels, and so forth on forms and
reports. Some controls may be bound to a field in the underlying recordset
(the Record Source for the form or report). These same controls may also be
unbound. Some controls such as labels and boxes cannot be bound.
 
B

BruceM via AccessMonster.com

Glad to help. Good luck with the project.
I put some codes into the form's Current event and it works! Thanks a lot!
I'm not sure I quite understand the situation, but if you enter data into an
unbound control it will remain there until you change the data or close the
[quoted text clipped - 25 lines]
 

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