Filtering a Form from a List Box

  • Thread starter Thread starter Anthony Viscomi
  • Start date Start date
A

Anthony Viscomi

I have a ListBox (its record source is a qry) on a Main Menu; it contains 2
columns (LocationID & Budget%). It displays records where the budget% is at
a critical stage (25%).

I would like to have the user be able to double click on the LocationID of a
particuliar record and open the Budget Data frm of that record.

I can handle the double click event in opening the Budget Data frm; but I'm
lost on how to filter for the record (LocationID) that the user selects.

Any thought?

Thanks!
Anthony
 
Use the WhereCondition parameter of docmd.openform

Docmd.openform "frmLocation",,,"LocationID=" & me.lstLocationId

Replace "frmLocation" with the name of the form you want to open and
"lstLocationId" with the name of your listbox control.
 
Like a charm...thanks!
Sandra Daigle said:
Use the WhereCondition parameter of docmd.openform

Docmd.openform "frmLocation",,,"LocationID=" & me.lstLocationId

Replace "frmLocation" with the name of the form you want to open and
"lstLocationId" with the name of your listbox control.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


Anthony said:
I have a ListBox (its record source is a qry) on a Main Menu; it
contains 2 columns (LocationID & Budget%). It displays records where
the budget% is at a critical stage (25%).

I would like to have the user be able to double click on the
LocationID of a particuliar record and open the Budget Data frm of
that record.
I can handle the double click event in opening the Budget Data frm;
but I'm lost on how to filter for the record (LocationID) that the
user selects.
Any thought?

Thanks!
Anthony
 
Back
Top