By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,486 Members | 2,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,486 IT Pros & Developers. It's quick & easy.

Search/Filter

spideynok
P: 14
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.

Share this Question
Share on Google+
5 Replies


NeoPa
Expert Mod 15k+
P: 31,186
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

spideynok
P: 14
can i ask sir NeoPa what code i need to put on it?
Mar 12 '12 #3

NeoPa
Expert Mod 15k+
P: 31,186
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

spideynok
P: 14
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
Expert Mod 15k+
P: 31,186
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.