populate a textbox based on the results of a query
Posted on 2004-08-02
Hi.. i have a form which contains a drop down menu with names of customers in it. the form populates based on what is selected from that drop down. this form is based on 'Customer Master Table' (cmt)
i have a textbox in this form that is not bound to any of the fields of this table. it comes from another table, 'Customer Collections Table' (cct).
Once a value on the form is selected i want to populate this box with its appropriate value from the collections table based on customerName & accNum.
I have already written a query that does this.. where would I put the query? my research online showed me i might need to use somethin called ADO recordset? no clue what that is..
this is my query..
SELECT SUM([Collections, Fee & General Ledger Table].[Payment Amount1] + [Collections, Fee & General Ledger Table].[Payment Amount2] + [Collections, Fee & General Ledger Table].[Payment Amount3]) AS TotalAmount
FROM [Collections, Fee & General Ledger Table]
WHERE [Customer Name] = MyForm!custNameBox.Value AND [Account Number] = MyForm!accNumBox.value AND [Date Received] = MyForm!dateBox.value;
and it works fine.. except dont know how to integreate it in the form..
help much appreciated..