Query displayed in List box

B

Bongard

Heres what I am trying to do. I have a list box on a form
(frm_WeightsDates) that is based from a query that looks like this.

SELECT qry_FactSetMonthlyPerformance.Name,
qry_FactSetMonthlyPerformance.MgrGrp,
qry_FactSetMonthlyPerformance.TotalReturns
FROM qry_FactSetMonthlyPerformance
ORDER BY [MgrGrp];

The only thing is my query has another parameter that is referring
back to two fields on the form [Start] and [Finish]. See my query
below. You can see in the WHERE clause that it is referring back to
two textboxes on the same form that my list box is on.

What I want to be able to do is create a small bit of code or some way
for the numbers in this list box to update on the push of a button
after I have manually updated the Start and Finish dates in the text
boxes. Right now, the only way I can get it to calculate is by typing
the desired values into the text boxes, going into design mode and
then coming back. Is there another way to get these query contained in
the list box to re-run itself?

My Query:
SELECT tbl_FactSetPerformance.Name, tbl_FactSetPerformance.Cusip,
Round([TotalReturn],4) AS TotalReturns, tbl_FactSetPerformance.MgrGrp,
tbl_FactSetPerformance.Start, tbl_FactSetPerformance.Finish
FROM tbl_FactSetPerformance
WHERE (((tbl_FactSetPerformance.Name)="Total") And
((tbl_FactSetPerformance.Start)=Forms!frm_WeightsDates!Start) And
((tbl_FactSetPerformance.Finish)=Forms!frm_WeightsDates!Finish));

Thanks in advance,
Brian
 

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