kellyputty
Technical User
I am stumped. If I use a literal string in my SQL query below I get the correct result. If I use the value in a textbox, I get nothing. Not sure why.
Below: if instead of what I have in bold I insert 1001009, my dbcAccountID populates correctly, but not with txtCustomerID.text.
Any thoughts?
Below: if instead of what I have in bold I insert 1001009, my dbcAccountID populates correctly, but not with txtCustomerID.text.
Any thoughts?
Code:
SQLCustomerAccount = "SELECT Customer.CustomerID, CustomerAccount.AccountID FROM Customer LEFT JOIN CustomerAccount ON Customer.CustomerID = CustomerAccount.CustomerID WHERE CustomerAccount.CustomerID = [b]'" & txtCustomerID.Text & "'[/b]"
With rsCustomerAccount
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open SQLCustomerAccount, conMB, , , adCmdText
End With
Set dbcAccountID.RowSource = rsCustomerAccount