Results 1 to 3 of 3

Thread: [Resolved] Please help me debug this SQL

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2009
    Location
    Worthing, UK
    Posts
    62

    [Resolved] Please help me debug this SQL

    Right I'm hoping someone will be able to help me I'm trying to get some text boxes to fill relative to what is in the drop down menu

    To load the combobox with data I'm using the FillCombo code available on here.

    this is what fills the combo on frmLoad

    Code:
    Call FillCombo(cboCustomerName, cn, "SELECT CustomerName, CustomerID FROM tblCustomers ORDER BY CustomerName", "CustomerName", "CustomerID")
    Now i think the error is somewhere below, when you click on the drop down menu it errors
    Code:
    strSQL = "SELECT CustomerID, CustomerName " & "FROM tblCustomers " & "WHERE CustomerName = " & cboCustomerName.ItemData(cboCustomerName.ListIndex)
    Basically I need to set the variable CuID (Customer ID) to the CustomerID of the name that you select in the drop down menu, with the current SQL I'm getting errors.
    Last edited by RossW-S; May 4th, 2009 at 10:57 AM. Reason: Set as Resolved

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Please help me debug this SQL (pretty urgent due to lack of time!)

    Look like this
    CustomerName
    Should be
    CustomerId

    in the Where clause.

    What is the actual error?
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2009
    Location
    Worthing, UK
    Posts
    62

    Re: Please help me debug this SQL (pretty urgent due to lack of time!)

    Why on earth didn't I see that!

    thank you fixed!

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