Requery Subforms

  • Thread starter RedHeadedMonster via AccessMonster.com
  • Start date
R

RedHeadedMonster via AccessMonster.com

Ok, i've gone thru I dont know how many threads on this subject and cant find
a working solution for the following problem.

I have a main form: frmMEIs
On this main form I have several subforms. Two of which are sfrmLabor and
sfrmMEICost.

sfrmLabor has a table as a record source - tblLabor
sfrmMEICost has a query as a record source - qryMEICostLookup

Bascially what the form does is allow a user to see the cost of all the parts
that it takes to build a MEI. One item that is added to the cost is Labor.
If the user changes the Labor hours in sfrmLabor, I need it to update in
sfrmMEICost.

Labor hours are based on historical # of hours it takes to build an item, so
it changes periodically.

I've tried the following with no luck on the AfterUpdate event of the Labor
Hours on sfrmLabor:

Forms!frmMEIs!sfrmMEICost.Form.Requery
Forms!frmMEIs.sfrmMEICost.Form.Requery
Forms!frmMEIs!sfrmMEICost.Form.Refresh
Forms!frmMEIs.sfrmMEICost.Form.Refresh

Any ideas would be wonderful.
Thanx!
RHM
 
B

Bill - ESAI

have you tried using On Change

and how about using Me.Refresh or Me.Requery on the event.

That's just a guess on my part. I just had a similar issue yesterday and
ended up having to use the Mouse Down and Mouse Up events in order to get a
good trigger. For whatever reason (probably an order of operation issue) On
Change and After Update wasn't working

Bill
 
K

Klatuu

You almost never want to use the Change event. Its name descibes when it
fires. It fires after every keystroke, so doing a requery in a change event
would be really ugly.

There is also a difference between a Requery and a Refresh. In most cases,
you will want to use the Requery.

I think the problem the OP is having has to do with correct referencing.
This syntax appears to be correct:

Forms!frmMEIs!sfrmMEICost.Form.Requery

However, there is one issue that needs review.
sfrmMEICost should be the name of a subform control on the form frmMEIs,
not the name of a form being used as a subform. The Form reference takes
care of that.


Bill - ESAI said:
have you tried using On Change

and how about using Me.Refresh or Me.Requery on the event.

That's just a guess on my part. I just had a similar issue yesterday and
ended up having to use the Mouse Down and Mouse Up events in order to get
a good trigger. For whatever reason (probably an order of operation issue)
On Change and After Update wasn't working

Bill
 

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