Storing SQL results via Recordset in a text box

andatabase

New member
Local time
Today, 01:49
Joined
Jul 23, 2015
Messages
17
Hello,
I am currently building a form where I need to store the results of an SQL into a text box.
The results will be a one field query, where it will display the Customer names. The bit I am stuck on is not the SQL, but to go through the results and assigning it to a textbox.
Will I need to do a for loop and assign to an array? If so, I will need some assistance with the coding. Thanks in advance!
 
Why not use a listbox? You can bind the recordset directly. If not you need to loop and create a concatenated string.
 
Listbox won't help as this needs to be for info only. This text box will display the customers for selected records:
"Selection includes: Customer A, Customer B"

Thanks for your suggestion, mind.

I will need some help on the for loop and concat string, if that is the case.
 
I will need some help on the for loop and concat string, if that is the case
That referenced thread shows 2 generic functions or a way to roll your own as I prefer.
 
Woops! Sorry, just read the header. I will have a look.

thanks
 
If your main form is not Continuous then you can add a subform or subreport to show this. That is the easiest method. You can set the properties of the subform to be "read only" and a subreport is display only anyways. Only need to concatenate if in continuous view like the thread.
 
Maybe this should be moved to VBA forum, not Macros
 

Users who are viewing this thread

Back
Top Bottom