Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RS Filter Question
Message
From
02/09/2001 22:34:45
 
 
To
31/08/2001 12:20:55
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00551495
Message ID:
00551671
Views:
19
This message has been marked as the solution to the initial question of the thread.
>ADO
>rsExtension.Filter = "ExtNum=" & listExt.SelectedItem
>
>Normally, "listExt.SelectedItem" returns a 3 or 4 digit number (i.e. "200") and the Filter works fine.
>
>Ocassionaly, "listExt.SelectedItem" returns a Chr and a number (i.e. "L25"), at which point the Filter returns Run-time error 3001.
>
>How can I make the Filter accept a Chr/Num combination like this?

Is this for a ListView control? The regular VB listbox doesn't have a SelectedItem property.

Anyway, assuming that listExt.SelectedItem returns a list's item text and if the ExtNum field is a char type, it should work if you always enclose the filter condition within single quotes:
rsExtension.Filter = "ExtNum='" & listExt.SelectedItem & "'"
It wouldn't make much sense that you would be looking for different types in the same field anyway.
HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform