A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to clear the previous data



 
 
Thread Tools Display Modes
  #1  
Old February 22nd, 2010, 03:02 PM posted to microsoft.public.access.forms
Tim
external usenet poster
 
Posts: 780
Default How to clear the previous data

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.
  #2  
Old February 22nd, 2010, 03:46 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default How to clear the previous data

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.

Tim wrote:
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.


--
Message posted via http://www.accessmonster.com

  #3  
Old February 22nd, 2010, 07:26 PM posted to microsoft.public.access.forms
Tim
external usenet poster
 
Posts: 780
Default How to clear the previous data

I put some codes into the form's Current event and it works! Thanks a lot!

"BruceM via AccessMonster.com" wrote:

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.

Tim wrote:
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.


--
Message posted via http://www.accessmonster.com

.

  #4  
Old February 23rd, 2010, 12:13 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default How to clear the previous data

Glad to help. Good luck with the project.

Tim wrote:
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]
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.


--
Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.