Requery Subform with no events

C

carriey

Hi - I'm having a bad day today - second post on a totally different topic -
maybe I'm not thinking clearly but I am stumped.

I have a main form Frm_Employee with a subform Frm_PayData
(continuous)Pay_Data actually comes from Qry_Pay_Data. The user is to enter
various pay related items: Commissions, Car Allowance, Benefits etc. but each
employee will vary on what fields get filled out.

I then built another query Qry_PayData_Totals where I do the SumOf each
field. I am doing this in a query instead of on the form because the User
wishes to report on these totals with some other information. So, I built
another subform on the main form Frm_PayTotals.

I need the Frm_PayTotals to requery so that when pay data is entered the
totals update (instead of moving to another record and coming back). I can't
seem to figure out where to put the Requery. There is nothing in this form
to enter so, I can't do it On Load or Enter or anything like that. I even
tried using that Refresh Form Data button but that didn't work.

I know there are a gazillion posts on this and I read some and tried them
out but I think I am mixed up on where the requery needs to go.

Thanks in advance for your advice!
 
J

John Smith

I would think that a Requery of Frm_PayTotals in the AfterUpdate event of
Frm_PayData would be the correct place for you.

I'm assuming that you can see both forms at once and want to keep them
synchronised. If they are on different tabs of a tab control and several
records would be entered on Frm_PayData at one time then requerying in the
change event of the tab control when the totals tab is selected would reduce
the over-head.

HTH
John
##################################
Don't Print - Save trees
 
C

carriey

OK - in the After Update event of Frm_PayData, I am putting

Me![Frm_PayTotals].Form.Requery

but I keep getting an error message that it can't find Frm_PayTotals

Do I have something wrong with my syntax?

Thanks!!!!!
 
J

John Smith

I think that you have both Frm_PayData and Frm_PayTotals as sub-forms of
Frm_Employee, so if your code is on Frm_PayData you would need:

Parent![Frm_PayTotals].Form.Requery

John
##################################
Don't Print - Save trees
OK - in the After Update event of Frm_PayData, I am putting
Me![Frm_PayTotals].Form.Requery
but I keep getting an error message that it can't find Frm_PayTotals
Do I have something wrong with my syntax?

John Smith said:
I would think that a Requery of Frm_PayTotals in the AfterUpdate event of
Frm_PayData would be the correct place for you.

I'm assuming that you can see both forms at once and want to keep them
synchronised. If they are on different tabs of a tab control and several
records would be entered on Frm_PayData at one time then requerying in the
change event of the tab control when the totals tab is selected would reduce
the over-head.
 

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

Similar Threads


Top