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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Real time change in Subform linked to query 1

Status
Not open for further replies.

Scrofani

Technical User
Mar 2, 2005
5
0
0
US
I am REALLY new at this.

I have a form "holdings" with a subform "results" list box that points to a query. Above the subform I created a combo box with a drop down choosing from a list of ticker symbols. When I change the ticker, I would like the subform to update automatically. To try to get around this, I added a button/macro that updates the query and closes it. But the subform does not update unless I close and reopen the "holdings" form or move to design view and back.

I search through this forum and saw many of these types of questions and many responses have been docmd.requery but I am unfamiliar with coding. I figured there had to be an option in Properties of the subform (i.e. OnCurrent) that would solve this.

Thanks for the help.
 
In design view, view the properties of the combo box. scroll down to the Change event. Choose [Event Procedure] to the right, then click the build button (the little button with three dots on it to the right). Type

Me.Results.Requery

assuming "Results" is the name of your subform.

Try that...

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
That easy, huh?! Well, thank you very much GingerR, it worked perfectly. You made my weekend. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top