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

Search in a table with "findfirst" method

P: 53
Hi all & The best wishes for you

I want to search in a table with "findfirst" method upon tow variables,val and val2, but findfirst can not find any record with the match criteria and "NoMatch" property shows true when search become finished however the match record exists in the table!
this is the criteria expression:
Expand|Select|Wrap|Line Numbers
  1. SearchSTR = "[Pack_no]= ' " & val & " ' And [Item_no]= ' " & val2 & " ' "
Val is a string variable and Val2 is a numeric variable

Please help me
Apr 8 '10 #1

✓ answered by missinglinq

These things are always confusing to me, so I keep some exemplars. This should work if the info supplied is correct.
Expand|Select|Wrap|Line Numbers
  1. SearchSTR = "[Pack_no]= '" & Val & "' And [Item_no]= " & val2
Linq ;0)>

Share this Question
Share on Google+
5 Replies


missinglinq
Expert 2.5K+
P: 3,532
These things are always confusing to me, so I keep some exemplars. This should work if the info supplied is correct.
Expand|Select|Wrap|Line Numbers
  1. SearchSTR = "[Pack_no]= '" & Val & "' And [Item_no]= " & val2
Linq ;0)>
Apr 8 '10 #2

P: 53
Great!
Thanks So.It worked correctly.
Who knows a complete reference to specify criteria strings in VBA?
Apr 9 '10 #3

P: 53
Thanks So.Looks Good!
I'll read it.
Bye
Apr 9 '10 #5

NeoPa
Expert Mod 15k+
P: 31,186
I hope it helps you :)

Welcome to Bytes!
Apr 12 '10 #6

Post your reply

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