column property of listbox in query?

G

Guest

i have a query, outside.. not embedded in code.. that i want to include my
listbox column property in my where clause:.. here is what i have:
SELECT tblCheckReqAmtsToAccts.Amount, tblCheckReqAmtsToAccts.GLAccountNo
FROM tblCheckReqAmtsToAccts
WHERE
(((tblCheckReqAmtsToAccts.ID)=Forms!frmMain!lstboxCheckRequest.Column(0)));

i am getting an undefined function error message.. anyone have any ideas?
I have 1 more question.. i have a report and i want this same listbox to be
the recordsource of the report.. so can i just set each field's control
source property to the columnn value (i.e.
forms!frmMain!lstboxCheckRequest.Column(1))??
this listbox is on my frmMain form that is inn the background.. whe they
select to print report (option on my frmMain) i want the report to report on
what is currently in the listbox.. Is this the right way to go about getting
the report results that i want? thanks so much!
 
D

Duane Hookom

You can't use a column property of a list box. You could leave off the
Column(x) and refer to just the listbox value. Other methods include
wrapping the expression in Eval()
ID=Eval("Forms!frmMain!lstboxCheckRequest.Column(0)")
or
binding a text box on frmMain to the column and using this new text box as
the criteria.
 

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