|
-
Aug 4th, 2002, 03:40 PM
#1
[RESOLVED] Syntax problem
Hi
What is wrong with this code:
DatGruppe.Recordset.FindFirst "Type Like '" & grTyp & "'" And "Diameter Like '" & grDia & "'"
-
Aug 4th, 2002, 04:06 PM
#2
Addicted Member
DatGruppe.Recordset.FindFirst "Type Like '" & grTyp & "' And Diameter Like '" & grDia & "'"
Check the concat' operand again
-
Aug 4th, 2002, 04:26 PM
#3
Frenzied Member
Find doesn't support multiple fields....
-
Aug 5th, 2002, 10:27 AM
#4
Hyperactive Member
Use '.Filter' instead for multiple criteria.
Nate
-
Aug 7th, 2002, 04:35 PM
#5
New Member
Now mocode = Mosteel
filter didn´t work ....
Please help..... Mosteel
-
Aug 7th, 2002, 05:08 PM
#6
Hyperactive Member
The problem could be a couple of things:
1) If the data type of a field is string, you need to use the single quotes around the value. If the data type is numeric, you do not use the single quotes.
2) It may also have to do with the Like pattern you are using. You are not using an * anywhere in your like strings. Consequently, it may be searching for an exact match. So, you may have to do something like these:
VB Code:
'For items that begin with your criteria string
DatGruppe.Recordset.Filter = "Type Like '" & grTyp & "*' And Diameter Like '" & grDia & "*'"
'For items where your string could be anywhere in the field data
DatGruppe.Recordset.Filter = "Type Like '*" & grTyp & "*' And Diameter Like '*" & grDia & "*'"
'To restore your recordset to all records
DatGruppe.Recordset.Filter = ""
'or
DatGruppe.Recordset.Filter = adFilterNone
Give those ideas a shot. Also, note that unlike the Find methods, Filter is a property so you have to use the equal sign in front of your criteria string.
Hope this helps.
Nate
-
Aug 8th, 2002, 05:20 PM
#7
New Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|