If I have a table with say 10 Fields, Client1--->Client10, How can I create
a query to list all clients in to one column from all 10 fields?
How about just using some DAO code.
Add a new table to the database "tblNewTable".
FieldName [ID] AutoNumber NoDuplicates PrimeKey field
FieldName [NewField] Text datatype
Paste the below code into a new module.
Change the table and field names as needed.
My sample uses 3 fields. Just add your additional ones as needed.
Public Sub AddToOneField()
Dim db As DAO.Database
Dim rsTo As DAO.Recordset
Dim rsFrom As DAO.Recordset
Set db = CurrentDb
Set rsTo = db.OpenRecordset("tblNewTable")
Set rsFrom = db.OpenRecordset("tblOriginalTable")
rsFrom.MoveFirst
Do While Not rsFrom.EOF
With rsTo
.AddNew
!Newfield = rsFrom![Client1]
.Update
.AddNew
!Newfield = rsFrom![Client2]
.Update
.AddNew
!Newfield = rsFrom![Client3]
.Update
End With
rsFrom.MoveNext
Loop
rsTo.Close
rsFrom.Close
Set rsFrom = Nothing
Set rsTo = Nothing
End Sub