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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|