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

Search (Filter) one form from another

P: 9
I am trying to set up a filter form that will filter data on another in a certain field.

Right now I have a text box (Text13) and a Command Button. The Button code is:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command15_Click()
  2. Dim code As String
  3. Dim inboundform As String
  4.  
  5.  
  6. code = "[Input Codes]='" & Me.Text13 & "'"
  7.  
  8.  
  9. DoCmd.OpenForm "Project Inbound", acNormal, , code
  10. End Sub
The problem is, I want to be able to type in part of what I am filtering... for instance the field may contain the value "NEW";"NEW, NEW2, NEW3"; or "NEW, TEST" I want to be able to type in NEW in order to get all 3 records back.

Any ideas?
Dec 5 '07 #1
Share this Question
Share on Google+
2 Replies


puppydogbuddy
Expert 100+
P: 1,923
I am trying to set up a filter form that will filter data on another in a certain field.

Right now I have a text box (Text13) and a Command Button. The Button code is:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command15_Click()
  2. Dim code As String
  3. Dim inboundform As String
  4.  
  5.  
  6. code = "[Input Codes]='" & Me.Text13 & "'"
  7.  
  8.  
  9. DoCmd.OpenForm "Project Inbound", acNormal, , code
  10. End Sub
The problem is, I want to be able to type in part of what I am filtering... for instance the field may contain the value "NEW";"NEW, NEW2, NEW3"; or "NEW, TEST" I want to be able to type in NEW in order to get all 3 records back.

Any ideas?
Try this in your code (FYI Chr(42) is ASCii for the wildcard symbol *):

code = "[Input Codes] Like '" & Chr(42) & Me.Text13 & Chr(42) & "'"
Dec 6 '07 #2

P: 9
Try this in your code (FYI Chr(42) is ASCii for the wildcard symbol *):

code = "[Input Codes] Like '" & Chr(42) & Me.Text13 & Chr(42) & "'"

worked great... thanks!
Dec 6 '07 #3

Post your reply

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