From: Tim on 22 Feb 2010 10:02 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.
From: BruceM via AccessMonster.com on 22 Feb 2010 10:46 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
From: Tim on 22 Feb 2010 14:26 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 > > . >
From: BruceM via AccessMonster.com on 23 Feb 2010 07:13 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
|
Pages: 1 Prev: Use same form in each tab Next: Understanding form loading on Open |