Results 1 to 2 of 2

Thread: Filtering records in a recordset(SQL)

  1. #1
    Guest

    Post

    Hi,
    I am using SQL command to Filter records in "Orders" table so that I can have list of Orders placed by individual employee . I also have "Employees" table with a Combobox populated with "employeenames". These two tables are linked by their "employeeID". I am having problem filtering the "Orders" table when I click on the combobox on the "Employees" table. When I click the combobox, I get an error "Type mis-march" on the SQL statement. Attached is part of the code. Any help would be appreciated. Thanks.

    Albert

    Private combo1_click()

    SQLconnect = "Select OrderID,OrderDate from Employees, Orders Where Employees.[EmployeeID] = Orders.[EmployeeID]" _
    And "Lastname='" & Combo1.Text & "'"

    Load Form2
    Form2.Show

    End Sub


  2. #2
    Guest

    Post

    SQLconnect = "Select OrderID,OrderDate from Employees, Orders Where Employees.[EmployeeID] = Orders.[EmployeeID]" _
    And "Lastname='" & Combo1.Text & "'"


    Should be

    SQLconnect = "Select OrderID,OrderDate from Employees, Orders Where Employees.[EmployeeID] = Orders.[EmployeeID]" _
    & " And Lastname='" & Combo1.Text & "'"

    ------------------

    Vincent van den Braken
    EMail: [email protected]
    ICQ: 15440110
    Homepage: http://www.azzmodan.demon.nl




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