hi, i have a form which has a combobox which the user needs to choose a phone number from a customer, after update, vba places the value in a variable, then i have listbox that needs to show up for the customer with all orders from that phone number.
so i placed a Sql string for the Raw Source in vba, but nothing pulls up, here is my code.
can anyone tell why its not working?Dim SQL As String
SQL = "SELECT DISTINCT Orders.PurchaseDate, Orders.OrderID" _
& "FROM Orders INNER JOIN Customers ON Orders.CustomerID = Customers.ID" _
& "WHERE Customers.Phone = '" & PhoneNum & "'"
Me.OrderList.RowSource = SQL
Me.OrderList.Visible = True
thanks in advanced.