Setting Textbox with SQL

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I want to set the data in a textbox using SQL but it doesn't seem to be
working, any help appreciated.
Thanks
DS




With Me.Textbox
..ControlSource = "SELECT SalesDetailsMoney.SalesID, " & _
"SalesDetailsMoney.QtyPrice, SalesDetailsMoney.BasePrice, Items.Tax " & _
"FROM SalesDetailsMoney INNER JOIN Items ON SalesDetailsMoney.ItemID =
Items.ItemID " & _
"WHERE
(((SalesDetailsMoney.SalesID)=[Forms]![CheckPreview]![TxtSalesID]) AND
((Items.Tax)=1));"
End With
 
You can't use a SQL string as the Control Source of a text box. You can use
domain aggregate functions such as in your previous post.
 
Duane said:
You can't use a SQL string as the Control Source of a text box. You can use
domain aggregate functions such as in your previous post.
Thanks, I realise that now.
DS
 
Back
Top