473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Search in a table with "findfirst" method

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)>

5 2565
missinglinq
3,532 Expert 2GB
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
Great!
Thanks So.It worked correctly.
Who knows a complete reference to specify criteria strings in VBA?
Apr 9 '10 #3
Thanks So.Looks Good!
I'll read it.
Bye
Apr 9 '10 #5
NeoPa
32,556 Expert Mod 16PB
I hope it helps you :)

Welcome to Bytes!
Apr 12 '10 #6

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

Similar topics

2
by: Armando | last post by:
This is driving me nuts - I 'm trying to open a table programmatically, to add or modify records, and I can't put all the pieces together to make it work in Access 2000. I have all sorts of apps...
1
by: jphelan | last post by:
I ran a MS Access Analyzer program that suggested changing, "rst.FindFirst strcriteria" to using the, "Seek" instead. I tried making the change. I get a Compile error that says, "Argument is not...
5
by: MLH | last post by:
I have a table I can open as table type recordset or a dynaset. Searching for a particular value in the table's main keyfield, which would be faster and less strain on the application......
1
by: DaveA | last post by:
Our incident numbering system is based on the following YEAR 05 MONTH 06 NMBR 1234 looks like 05-06-1234 the counter number is manually reset each month and I would like to make it...
2
by: rivka.howley | last post by:
I wrote some code that creates a table with a date/time field at 15-minute intervals. Here's how I create and populate the table With tblDataTemp ..Fields.Append .CreateField("CT_ID", dbLong)...
0
by: JC | last post by:
I have a list box loaded with Student Name, Social Security. When the user click on a specific record, the following code is assigned to the lstStudent1_AfterUpdate procedure. Private Sub...
1
by: asavu | last post by:
Hello, I'm somewhat new to this, and I definately need some help. I have a db for a small business, and I have a main form, Customer Info, which has a subform Appliance Info, which has a subform...
7
by: waltvw | last post by:
I'm using FindFirst method in Access VBA to find a particular record in a recordset. I have 2 search criteria each of which works just fine if used separately as an argument in FindFirst, but NOT in...
1
by: mastro78 | last post by:
I'm using 2002 I defined my recordset as rWrkSheet Spreadsheet is the field in table Spreadsheets PathToExcelFiles is the full path where the Excel files i'm ref is stored ExcelFileName is the...
25
by: Rick Collard | last post by:
Using DAO 3.6 on an Access 2002 database, I'm getting unexpected results with the FindFirst method. Here's the simple code to test: Public Sub FindIt() Dim db As Database, rs As Recordset...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.