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!

ListView ctrl & Windows XP

Status
Not open for further replies.

agfon

Programmer
Mar 25, 2005
38
0
0
US
I'm experiencing a problem with a query that references the selected item within a ListView. The query criteria is as follows:

[blue]WHERE (((Table1.Rec_ID)=[Forms]![frm_main]![ListView1].[SelectedItem]))[/blue]

Prior to receiving Windows XP, this query fired without any issue. Now, it prompts the user for this parameter. I've tried encapsulating the reference in the EVAL function without success.

I would appreciate any advise on this.

-agfon

-agfon
 
By-the-way, I tried dropping this reference into VBA and it did produce the desired results.

-agfon

-agfon
 
Is this a list box? If not, why not? If it is a single select list box which has the appropriate bound column, try:

WHERE (((Table1.Rec_ID)=[Forms]![frm_main]![ListView1]))

The form must be open.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Duane,

This is a ListView - not a ListBox. The ListView has functionality that the ListBox doesn't.


-agfon
 
Try
WHERE (((Table1.Rec_ID)=[Forms]![frm_main]![ListView1].[SelectedItem].Text)).
Listview consider all of them as string not integer.

for more read my FAQ(faq702-6026)

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
try working with it as an object rather then referencing it directly, once you get the hang of it, it's much easier.

Create a function or sub such as

Public function GetListViewID(lst as listview) as long

dim lRetval as long

if not lst.selecteditem.text = "" then
id = val(lst.selecteditem.text)
end if

end function

function call:

ID = GetListViewID(listview1.object)


Mark P.
Providing Low Cost Powerful Point of Sale Solutions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top