Results 1 to 7 of 7

Thread: [RESOLVED] Syntax problem

  1. #1
    mocode
    Guest

    Resolved [RESOLVED] Syntax problem

    Hi

    What is wrong with this code:

    DatGruppe.Recordset.FindFirst "Type Like '" & grTyp & "'" And "Diameter Like '" & grDia & "'"

  2. #2
    Addicted Member
    Join Date
    May 2001
    Location
    Thailand
    Posts
    221
    DatGruppe.Recordset.FindFirst "Type Like '" & grTyp & "' And Diameter Like '" & grDia & "'"

    Check the concat' operand again
    Teeravee Sirinapasawasdee
    Gestalt IT Consulting Group
    Growth Your Business With e-Process

  3. #3
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    Find doesn't support multiple fields....

  4. #4
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Omaha, NE
    Posts
    270
    Use '.Filter' instead for multiple criteria.

    Nate

  5. #5
    New Member
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    13

    Now mocode = Mosteel

    filter didn´t work ....

    Please help..... Mosteel

  6. #6
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Omaha, NE
    Posts
    270
    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:
    1. 'For items that begin with your criteria string
    2. DatGruppe.Recordset.Filter = "Type Like '" & grTyp & "*' And Diameter Like '" & grDia & "*'"
    3.  
    4. 'For items where your string could be anywhere in the field data
    5. DatGruppe.Recordset.Filter = "Type Like '*" & grTyp & "*' And Diameter Like '*" & grDia & "*'"
    6.  
    7. 'To restore your recordset to all records
    8. DatGruppe.Recordset.Filter = ""
    9. 'or
    10. 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

  7. #7
    New Member
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    13

    Thanks

    Thank you i´t works

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width