Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Royal Oak, Michigan, USA
    Posts
    255
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL Friendly (V2000 SR1)

    I'm helping a friend convert an Access back-end database into a SQL Server back-end. We are testing some of the Access commands on the front-end and are fixing errors as we find them. One bit of coding I can't seem to figure out is this bit:

    ' This code uses the After Update event of a drop-down named: cboLName to find a specific customer
    Me.cboLName.Requery
    ' The following code looks for the last name in the field CustomerLName and goes to that record.
    Me.RecordsetClone.FindFirst "[CustomerLName] " & Me.cboLName
    Me.Bookmark = Me.RecordsetClone.Bookmark

    It functions perfectly in Access but pulls up incorrect names using SQL and an ODBC connection. Does anyone know the proper coding or why it doesn't function with a SQL back-end?
    Thanks!!

  2. #2
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Mishawaka, Indiana, USA
    Posts
    145
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL Friendly (V2000 SR1)

    Just a thought. Try using the complete name for [CustomerLName]. Include the table name. i.e.

    [tblMyTableName]![CustomerLName] Substitute your table name for tblMyTableName.

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: SQL Friendly (V2000 SR1)

    You had:
    ??Me.RecordsetClone.FindFirst "[CustomerLName] " & Me.cboLName<

    Try this instead:
    Me.RecordsetClone.FindFirst "[CustomerLName] =" & chr(34) & Me.cboLName chr(34)
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Royal Oak, Michigan, USA
    Posts
    255
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL Friendly (V2000 SR1)

    Thanks Tom,
    For some reason, this bit of code just didn't want to work. I ended up using FindRecord instead and that has worked without a snag.
    Thanks for the idea and have a great week!

  5. #5
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Royal Oak, Michigan, USA
    Posts
    255
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL Friendly (V2000 SR1)

    Mark,
    Thanks for the help. I used SetFocus to go to the proper control and then ended up using FindRecord to properly find what I needed. For some reason the other code was inconsistent (even with the change you suggested).
    Thanks for the idea and have a great week!

Posting Permissions

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