Refresh form data

  • Thread starter Thread starter Ruth Isaacs
  • Start date Start date
R

Ruth Isaacs

Hello All
I have a main form called [frm x main], on which there is a subform (in
datasheet view) called [qry x main table subform].
After entering data into [qry x main table subform] the user clicks a button
on [frm x main] to run various queries.
The queries use the data entered via [qry x main table subform].
The problem is that data entered/amended in the last (final) record in [qry
x main table subform] is not recognised by the queries.
I realise this is because this record is still in 'edit' mode, and that the
user could (should) simply click on another record to 'enter' the data.
But some users will forget to do this, so need a way to 'enter' the data of
the last record via code.
I'm sure there is a command to 'refresh' the data in the subform, but I
cannot get the syntax.
Hope someone can help!
Many thanks
Leslie Isaacs
 
Me.MyMainForm.MySubFormControlName.Form.Requery

Or

Me.Requery will requery the main form and in turn refresh the subform.
 
Ray

Many thanks - both of your suggestions worked a treat!

Les


Ray Cacciatore said:
Me.MyMainForm.MySubFormControlName.Form.Requery

Or

Me.Requery will requery the main form and in turn refresh the subform.

Ruth Isaacs said:
Hello All
I have a main form called [frm x main], on which there is a subform (in
datasheet view) called [qry x main table subform].
After entering data into [qry x main table subform] the user clicks a
button
on [frm x main] to run various queries.
The queries use the data entered via [qry x main table subform].
The problem is that data entered/amended in the last (final) record in
[qry
x main table subform] is not recognised by the queries.
I realise this is because this record is still in 'edit' mode, and that
the
user could (should) simply click on another record to 'enter' the data.
But some users will forget to do this, so need a way to 'enter' the data
of
the last record via code.
I'm sure there is a command to 'refresh' the data in the subform, but I
cannot get the syntax.
Hope someone can help!
Many thanks
Leslie Isaacs
 
Back
Top