469,330 Members | 1,346 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

Search/Filter

spideynok
Goodmorning!

i have a code
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnFilter_Click()
  2.     Dim strFilter As String
  3.  
  4.     With Me
  5.         If .txtFindCardNumber > "" Then
  6.             strFilter = Replace(.txtFindCardNumber, ", ", ",")
  7.             strFilter = "[Card_Number] In('" & Replace(strFilter, ",", "','") & "')"
  8.         End If
  9.  
  10.         .Filter = strFilter
  11.         .FilterOn = (strFilter > "")
  12.     End With
  13. End Sub
this is the code on the button connected with a text box which i use when im searching a record.

the card number is compose of 16 digits. and i must enter 16 digits just to search for that record.

I want to ask if how would i do. so i can search on it even i input 6 numbers only etc..

Thank you in advanced. (~_^)olll
Mar 12 '12 #1

✓ answered by NeoPa

You can use either a list or wild-cards in filtering, but not a list of wild-card comparisons.

For more see Find Wildcard Characters in an Access Database.

5 1658
NeoPa
32,181 Expert Mod 16PB
You can use either a list or wild-cards in filtering, but not a list of wild-card comparisons.

For more see Find Wildcard Characters in an Access Database.
Mar 12 '12 #2
can i ask sir NeoPa what code i need to put on it?
Mar 12 '12 #3
NeoPa
32,181 Expert Mod 16PB
You can ask, but until you explain what you're trying to do more clearly I won't be able to help. I can see you're doing some sort of filtering, but the details make little sense to me.
Mar 12 '12 #4
Yes filtering.. and also like i use it as search. i had a unbounded text box.. and a find record button where i put that code.. and its like when.. example.. im looking for a card number 12345678 for me to show that data.. i need to put exact data like 12345678.. and i want to do is when i put 1234567.. all data that has 1234567 will show.. like 12345671, 12345678, 12345679.. like that..

Again thank you sir :)
Mar 12 '12 #5
NeoPa
32,181 Expert Mod 16PB
You'd use the wild-card character that matches your database. This is all explained fully and clearly in the linked article.
Mar 12 '12 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Dirk Hagemann | last post: by
3 posts views Thread by Dirk Hagemann | last post: by
reply views Thread by John Rager | last post: by
reply views Thread by jeffreycope | last post: by
2 posts views Thread by AJ | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.