Requery one subform from another subform

  • Thread starter Thread starter CJ
  • Start date Start date
C

CJ

Hi Groupies

My Main form (frmProjectMaster) contains 2 levels of subforms. The first
subform is frmCompartmentsWizard. frmCompartmentsWizard contains
fsubBlocksWizard and fsubReefersWizard. On fsubBlocksWizard, there is a
combo box called strStockCode that gets its data from tblReefers. tblReefers
happens to be the data source for fsubReefersWizard.

What I need to happen is this:
When a new record is added in fsubReefersWizard, I need the combo
box on fsubBlocksWizard to requery so that the new data shows up. I need to
stay in fsubReefersWizard.

I am having trouble figuring out how to write the requery for the combo.

Could somebody please get this straight for me?

Thanks for the brainwaves!
CJ
 
CJ said:
Hi Groupies

My Main form (frmProjectMaster) contains 2 levels of subforms. The first
subform is frmCompartmentsWizard. frmCompartmentsWizard contains
fsubBlocksWizard and fsubReefersWizard. On fsubBlocksWizard, there is a
combo box called strStockCode that gets its data from tblReefers. tblReefers
happens to be the data source for fsubReefersWizard.

What I need to happen is this:
When a new record is added in fsubReefersWizard, I need the combo
box on fsubBlocksWizard to requery so that the new data shows up. I need to
stay in fsubReefersWizard.


Use the fsubReefersWizard Form's AfterInsert event:

Parent.fsubBlocksWizard.Form.strStockCode.Requery
 
Marshall Barton said:
Use the fsubReefersWizard Form's AfterInsert event:

Parent.fsubBlocksWizard.Form.strStockCode.Requery

Hi Marsh

I tried that but the combo still does not update until after I close the
form and open it up again.

CJ
 
CJ said:
"Marshall Barton" wrote

I tried that but the combo still does not update until after I close the
form and open it up again.


I've never had a problem doing this kind of thing. Are you
sure you put everything in the right place with the right
names? OTOH, maybe there's another factor we need to take
into account.
 
Marshall Barton said:
I've never had a problem doing this kind of thing. Are you
sure you put everything in the right place with the right
names? OTOH, maybe there's another factor we need to take
into account.

No worries Marsh.

I was testing by only changing the value, not entering a new record. I had
to add the code to the After Insert event so that it updates after the value
is changed. It works perfectly!

Thanks
 
Back
Top