Refresh form data

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
 
R

Ray Cacciatore

Me.MyMainForm.MySubFormControlName.Form.Requery

Or

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

Leslie Isaacs

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top