Private Sub comboCatagory_ID_AfterUpdate()
Dim sProd_description As String
sProd_description = "SELECT products_table.product_id, products_table.prod_description " & _
"FROM products_table " & _
"WHERE products_table.prod_catagoryID = " & "'" & Me.comboCatagory_ID.Column(0) & "'" & _
" UNION SELECT 999999, 'Add New Product' As prod_description" & _
" ORDER BY product_id"
Me.comboProd_description.RowSource = sProd_description
Me.comboProd_description.Requery
End Sub
[end code]
when called to execute access gives the following message:
'Query input must contain at least one table or query.'
If I include a msgbox to report the string value of sProd_description access displays this:
SELECT products_table.product_id, products_table.prod_description FROM products_table
WHERE products_table.prod_catagoryID = 'ASCAS 27001'
UNION SELECT 999999, 'Add New Product' As prod_description
ORDER BY product_id
I am not sure how SQL works, but my understanding so far is that I have created a temparary table in memory with two columns (product_id & Prod_description) and it looks like I am trying to add or union a single column. Could this be my problem?
Thx
Kev