Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery subform by list selection

Status
Not open for further replies.

Nick366

MIS
Jan 28, 2004
20
US
My goal:
Have a listbox full of OfferIDs. I want to display the detailed information for a perticular OfferID when it has been selected in the listbox.

Here is what I am doing, that is not working:
Created table to hold the selected OfferID. Main form is based off of this table. Put a listbox on that main form (data coming from query). Created Subform for the detailed information and attached it to the main form, linking by OfferID.

When I select an OfferID from the listbox, then close and reopen the main form, the detailed info for the selected OfferID is displayed. How can I get this to happen on the fly? I want to be able to select one right after the other.

Names:
Main form - frmOfferDetails
-Listbox - OfferList
-Subform - OfferDetails
Subform - subfrmOfferDetails


 
Hi,

How about requerying the subform in the afterUpdate of the ListBox without linking the master to the child.

listbox afterUpdate()

Forms!frmOfferDetails.subfrmOfferDetails.Form.Requery

Hope that helps.
 
I think it is choking on me not moving out of that field. Since it is still editing the record, it has not been updated yet.

I did find a work around. I created another subform of a datasheet of the OfferIDs. Not as clean, but functional.

I still would like help on this question though. Not sure if it is possible...
 
Well, you could try adding a line:


listbox afterUpdate()

docmd.runcommand.accommandsaverecord

Forms!frmOfferDetails.subfrmOfferDetails.Form.Requery

Hope that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top