Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RS Filter Question
Message
De
02/09/2001 22:34:45
 
 
À
31/08/2001 12:20:55
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00551495
Message ID:
00551671
Vues:
18
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform