Hi all, I know this is just me being very picky and anal but I am genuinely interested in what is causing this problem.
So I wanted organize my SQL statement like I do in WinSQL but for some unknown reason Access doesn't like it. Here is the one that doesn't work:
Code:
Me.cboProductSelector.RowSource = "SELECT tblProducts.PRODID, tblProducts.PRNAME " & _
"FROM tblProducts " & _
"WHERE tblProducts.PRCUSTID = " & Me.cboCustomerSelector & _
"ORDER BY tblProducts.PRNAME"
Me.cboProductSelector = Me.cboProductSelector.ItemData(0)
And here is the one that does work:
Code:
Me.cboProductSelector.RowSource = "SELECT tblProducts.PRODID, tblProducts.PRNAME FROM" & _
" tblProducts WHERE tblProducts.PRCUSTID = " & Me.cboCustomerSelector & _
" ORDER BY tblProducts.PRNAME"
Me.cboProductSelector = Me.cboProductSelector.ItemData(0)
I really can't see why it considers them to be different. Do I misunderstand the & _ concatenation?
The second one gives me all of a customer's products in cboProductSelector and the first one gives me nothing
Thanks all,
Mart