Refresh combo box?

C

Chips

Using Access 2K

I have a main form (based on TblJob) containing a subform.

The subform (FrmSbSubCbyJob) has a combo box that chooses records from a
TblSubCont.

It fills in records in TblSubContbyJob

I have a command button that opens up a FrmSubcont for TblSubCont so that I
can add or edit records in it.

When I close the FrmSubCont I want it to refresh or requery the combo box in
FrmSbSubContbyJob so that it now displays the newly added, deleted, or
edited records correctly.

I have not been able to figure out how to do this. Any help would be
appreciated.

GC
 
K

Kevin S.

just go forms!FrmSbSubContbyJob! [your list box name here].requery

(if you need to requery a form, do the same thing...
forms!FrmSbSubContbyJob.requery)

-kevin
 
C

Chips

Would I put this in a "On Close" event for the FrmSubCont?

GC


Kevin S. said:
just go forms!FrmSbSubContbyJob! [your list box name here].requery

(if you need to requery a form, do the same thing...
forms!FrmSbSubContbyJob.requery)

-kevin


Chips said:
Using Access 2K

I have a main form (based on TblJob) containing a subform.

The subform (FrmSbSubCbyJob) has a combo box that chooses records from a
TblSubCont.

It fills in records in TblSubContbyJob

I have a command button that opens up a FrmSubcont for TblSubCont so
that
I
can add or edit records in it.

When I close the FrmSubCont I want it to refresh or requery the combo
box
in
FrmSbSubContbyJob so that it now displays the newly added, deleted, or
edited records correctly.

I have not been able to figure out how to do this. Any help would be
appreciated.

GC
 
K

Kevin S.

I believe so.


Chips said:
Would I put this in a "On Close" event for the FrmSubCont?

GC


Kevin S. said:
just go forms!FrmSbSubContbyJob! [your list box name here].requery

(if you need to requery a form, do the same thing...
forms!FrmSbSubContbyJob.requery)

-kevin


Chips said:
Using Access 2K

I have a main form (based on TblJob) containing a subform.

The subform (FrmSbSubCbyJob) has a combo box that chooses records from a
TblSubCont.

It fills in records in TblSubContbyJob

I have a command button that opens up a FrmSubcont for TblSubCont so
that
I
can add or edit records in it.

When I close the FrmSubCont I want it to refresh or requery the combo
box
in
FrmSbSubContbyJob so that it now displays the newly added, deleted, or
edited records correctly.

I have not been able to figure out how to do this. Any help would be
appreciated.

GC
 
C

Chips

When I put this in code for the FrmSubCont I get an error that it can't find
FrmSbSubCbyJob.

Private Sub Form_Close()

Forms!FrmSbSubCbyJob.Requery

End Sub

When I put this in code for FrmSbSubCbyJob, like on got focus or activate,
it doesn't update the combo box.

I tried this as well with Forms!FrmSbSubCbyJob!SubContractor.Requery

Thanks,

GC


Kevin S. said:
I believe so.


Chips said:
Would I put this in a "On Close" event for the FrmSubCont?

GC


Kevin S. said:
just go forms!FrmSbSubContbyJob! [your list box name here].requery

(if you need to requery a form, do the same thing...
forms!FrmSbSubContbyJob.requery)

-kevin


Using Access 2K

I have a main form (based on TblJob) containing a subform.

The subform (FrmSbSubCbyJob) has a combo box that chooses records
from
a combo
box
 

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