Populate a text box

Technodruid

New member
Local time
Today, 08:21
Joined
Aug 20, 2010
Messages
8
Hello, Here is what I'm trying to do, I have a select query that holds anywhere between 1 to a couple hundred records, I need to take the Name field and populate a textbox which after verification I write to a text file that I later use in a powershell script. So far have tried using VBA to create a variable and populate the textbox based on the string but it only provides me the first item, I've tried dmax and this gives me a single result last Item, Dlookup only gives me the first item, changed it to a listbox which populates the box correctly but only writes the selected item in to my text file. :banghead:

Any tips happily accepted.
 
Please tell us about the table used in the query.
 
Do you mean you want to populate a text box with 1 to a 100ish names from the name field?
 
It queries from another query. table is a list of AD accounts, first query verifies the status, the 2nd query (the one that has the list of names I need) shows me the disabled accounts, I want to write those in to the text box once verified against another query in another table I want to write the box to the text file which I then use to Hide the emailboxes with powershell.

@ Uncle Gizmo Yes
 
Seem to be what I'm looking for but I replaced your sql string with mine and It error out syntax error in from clause, the query is
Code:
SELECT qry_PICStatus.Name, qry_PICStatus.user_id, qry_PICStatus.user_id_type FROM qry_PICStatus WHERE (((qry_PICStatus.user_id_type)="y"));

So in your function I have it

Code:
Const strSQLWhere As String = "SELECT qry_PICStatus.Name, qry_PICStatus.user_id, qry_PICStatus.user_id_type " & _
"FROM qry_PICStatus" & _
"WHERE (((qry_PICStatus.user_id_type)= y));"
 
Okay after a little more work, I was missing a space once that was done had a little more playing around and Now it works great. Now if I could drop the ", " and put one per line it would be the best thing ever. but I can work with this. Thank you very much.
 
Found the Answer for that as well, add & vbcrlf in the recordset loop, for the strText line now for mine it is .. strText = strText & RS!Name & vbCrLf removed the comma and space. works great.
 

Users who are viewing this thread

Back
Top Bottom