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  

Clear the subform



 
 
Thread Tools Display Modes
  #1  
Old November 27th, 2009, 11:57 AM posted to microsoft.public.access.forms
.Len B
external usenet poster
 
Posts: 81
Default Clear the subform

I have a form whose job is to collect data in a subform in the
top half and display the past entries (uneditable) in the bottom
half. The RecordSource of the parent form (a query) has a 1-many
relationship with the RecordSource of the subform (a table). The
data in the parent is not intended to be edited. It is there to
provide a context for the subform data.

On the subform is a command button to save the data to the subform's
underlying table. This works fine but I also need it to clear the
subform to allow another entry.

I also want to update the list of past entries displayed in the
bottom half. I figure a Requery will update the display since the
fresh data is now in the table.

What is the best method of clearing/resetting the now-saved subform?

--
Len
__________________________________________________ ____
remove nothing for valid email address.


  #2  
Old November 27th, 2009, 10:11 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Clear the subform

If the subform has allow additions set to no, then change it to yes.
To go to a new record,
DoCmd.GoToRecord , , acNewRec


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

".Len B" wrote in message
...
I have a form whose job is to collect data in a subform in the
top half and display the past entries (uneditable) in the bottom
half. The RecordSource of the parent form (a query) has a 1-many
relationship with the RecordSource of the subform (a table). The
data in the parent is not intended to be edited. It is there to
provide a context for the subform data.

On the subform is a command button to save the data to the subform's
underlying table. This works fine but I also need it to clear the
subform to allow another entry.

I also want to update the list of past entries displayed in the
bottom half. I figure a Requery will update the display since the
fresh data is now in the table.

What is the best method of clearing/resetting the now-saved subform?

--
Len
__________________________________________________ ____
remove nothing for valid email address.




  #3  
Old November 29th, 2009, 12:27 PM posted to microsoft.public.access.forms
.Len B
external usenet poster
 
Posts: 81
Default Clear the subform

Thanks Jeanette,
All good but ...

acNewRec clears the subform just fine but it sends the parent
form to the first record of the recordset. How do I prevent
that? Or do I just send it back?

--
Len
__________________________________________________ ____
remove nothing for valid email address.
"Jeanette Cunningham" wrote in message
...
| If the subform has allow additions set to no, then change it to yes.
| To go to a new record,
| DoCmd.GoToRecord , , acNewRec
|
|
| Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
|
| ".Len B" wrote in message
| ...
| I have a form whose job is to collect data in a subform in the
| top half and display the past entries (uneditable) in the bottom
| half. The RecordSource of the parent form (a query) has a 1-many
| relationship with the RecordSource of the subform (a table). The
| data in the parent is not intended to be edited. It is there to
| provide a context for the subform data.
|
| On the subform is a command button to save the data to the subform's
| underlying table. This works fine but I also need it to clear the
| subform to allow another entry.
|
| I also want to update the list of past entries displayed in the
| bottom half. I figure a Requery will update the display since the
| fresh data is now in the table.
|
| What is the best method of clearing/resetting the now-saved subform?
|
| --
| Len
| __________________________________________________ ____
| remove nothing for valid email address.
|
|
|
|



  #4  
Old November 29th, 2009, 07:51 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default Clear the subform

If you put the acNewRec code on the subform, it shouldn't do anything to the
parent form.



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

".Len B" wrote in message
...
Thanks Jeanette,
All good but ...

acNewRec clears the subform just fine but it sends the parent
form to the first record of the recordset. How do I prevent
that? Or do I just send it back?

--
Len
__________________________________________________ ____
remove nothing for valid email address.
"Jeanette Cunningham" wrote in message
...
| If the subform has allow additions set to no, then change it to yes.
| To go to a new record,
| DoCmd.GoToRecord , , acNewRec
|
|
| Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
|
| ".Len B" wrote in message
| ...
| I have a form whose job is to collect data in a subform in the
| top half and display the past entries (uneditable) in the bottom
| half. The RecordSource of the parent form (a query) has a 1-many
| relationship with the RecordSource of the subform (a table). The
| data in the parent is not intended to be edited. It is there to
| provide a context for the subform data.
|
| On the subform is a command button to save the data to the subform's
| underlying table. This works fine but I also need it to clear the
| subform to allow another entry.
|
| I also want to update the list of past entries displayed in the
| bottom half. I figure a Requery will update the display since the
| fresh data is now in the table.
|
| What is the best method of clearing/resetting the now-saved subform?
|
| --
| Len
| __________________________________________________ ____
| remove nothing for valid email address.
|
|
|
|





 




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 11:06 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.