Updating/Refreshing Subform data

G

Guest

I have created a form (Main details) with 5 subforms (Visit1,
Visit2....Visit5). The subforms are only visible one at a time (5 tabs).
Subform Visit1 has a field (Date of visit) which is used to calculate
scheduled future date of visits in 4 other subforms(V2.....V5). I have
achieved this by creating 4 fields in Subform V1 (unbound calculated: Date of
visit+28, +56, +180 and +256). These dates are to be displayed on each
subform by refering to these in the subform1. I have achieved this by keeping
the subform Visit1 always open (hidden) with Main details form.
Once the Date of visit is entered in the Visit1 form, the dates correctly
displays on the other subforms BUT if for some reason Date of visit has to be
changed on the subform V1, the other 4 subforms do not update and keep on
showing the old dates. Is there a solution? Please help.

Thanks
 
G

Guest

Try and refresh the subforms on the after update event of the Date of visit

Me.Parent.v2.Requery
Me.Parent.v3.Requery
Me.Parent.v4.Requery
Me.Parent.v5.Requery
 
G

Guest

Many thanks Ofer. It worked.
In addition to your code, at the start I had to add the line Me.requery to
update the v1 otherwise it wouldn't work.
 

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