Query parameter from listbox

C

CJ

Hi Groupies

.........I detest list boxes......however, my database has a couple.

I need to be able to capture the value of the item selected in the list box
on my form and use the value in the first column as criteria in a query. My
darkest fear is that this is not possible in a query and I will have to
delve into the code behind the list box. Code is not my forte...

I have tried:

[Forms]![frmSiteReturns]![lstOnSite].[Selected]
[Forms]![frmSiteReturns]![lstOnSite].[Value]
....neither of which return anything...
and
[Forms]![frmSiteReturns]![lstOnSite].[Item]
....which returns an error.

Is this possible? If not, how can I capture the data?
 
C

CJ

Hi

Unfortunately, your suggestion did not work. It listed all of possible items
from the entire database.
I ended up using a text box on the form to capture the value and then
referenced the
text box in my query.

--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!
MGFoster said:
CJ said:
Hi Groupies

........I detest list boxes......however, my database has a couple.

I need to be able to capture the value of the item selected in the list
box on my form and use the value in the first column as criteria in a
query. My darkest fear is that this is not possible in a query and I will
have to delve into the code behind the list box. Code is not my forte...

I have tried:

[Forms]![frmSiteReturns]![lstOnSite].[Selected]
[Forms]![frmSiteReturns]![lstOnSite].[Value]
...neither of which return anything...
and
[Forms]![frmSiteReturns]![lstOnSite].[Item]
...which returns an error.

Is this possible? If not, how can I capture the data?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Make sure the ListBox's Properties are like this:

Multi Select: Simple
Bound Column: 1


Then use this reference in the query:

PARAMETERS [Forms]![frmSiteReturns]![lstOnSite] TEXT;
SELECT ...
... etc. ...

Change the data type of the ListBox value (it's TEXT now) to whatever it
really is, before using.

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSnrJl4echKqOuFEgEQI/fQCeN+T70pGJhjkwG6/R52y5Logw1eAAoO1I
c6ydpsSRpKq1cS3s7VPe91SW
=EeG4
-----END PGP SIGNATURE-----
 
C

CJ

Hi Bonnie

I thought I had tried that but I guess not.

Thanks for the info!

--
Thanks for taking the time!

CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!
bhicks11 via AccessMonster.com said:
Hi CJ

Forms!frmSiteReturns.IstOnSite.Column(0)

List/Combo Boxes are numbered starting with zero. First column is zero,
etc.


Bonnie
http://www.dataplus-svc.com
Hi Groupies

........I detest list boxes......however, my database has a couple.

I need to be able to capture the value of the item selected in the list
box
on my form and use the value in the first column as criteria in a query.
My
darkest fear is that this is not possible in a query and I will have to
delve into the code behind the list box. Code is not my forte...

I have tried:

[Forms]![frmSiteReturns]![lstOnSite].[Selected]
[Forms]![frmSiteReturns]![lstOnSite].[Value]
...neither of which return anything...
and
[Forms]![frmSiteReturns]![lstOnSite].[Item]
...which returns an error.

Is this possible? If not, how can I capture the data?
 

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