Setting Textbox with SQL

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
 
D

Duane Hookom

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.
 
D

DS

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SQL Woes 4
SQL Syntax Error 3
SQL Rowsource 2
Sum of SQL Statement 1
SQL Rowsource 1
SQL on the fly...? 7
Listbox SQL 3
DLookup, unbound controls questions 0

Top