Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a query that gives the follo

Status
Not open for further replies.

awhittle

Technical User
Feb 19, 2003
8
0
0
US
I have a query that gives the following results

Entry Description
1.0001 FRAME Wall 25GA TO STR
1.0001 HANG FCX TO STR
1.0001 PAINT Wall
1.0002 FRAME Wall 25GA REG
1.0002 HANG FCX REG
1.0003 FRAME Wall 25GA REG
1.0003 HANG FCX REG

What I need is.

Entry Description
1.0001 FRAME Wall 25GA TO STR, HANG FCX TO STR, PAINT Wall
1.0002 FRAME Wall 25GA REG, HANG FCX REG
1.0003 FRAME Wall 25GA REG, HANG FCX REG

Is there a way to do this with VB or some query function? Like a sum function but "sum the lables"

Andy
 
One way to do this would be to create a temporary table that has this information, building it with an update query from your original data. select all the 1.0001s, append record 2's label to record 1's label, etc.

Just a thought, hope it helps.

MG
 
Here is the solution we found. This works like a champ.

I hope this helps someone else.

AW

Public Function Pivot_Steps(Entry As String) As String
On Error GoTo Pivot_err
Dim StepLine As String, SQLTxt As String
Set dbs = CurrentDb
SQLTxt = "Select qryYellowDesc.Description from qryYellowDesc where qryYellowDesc.Entry = '" & Entry & "';" 'Need an Order By field for this
Set SQ = dbs.OpenRecordset(SQLTxt)
With SQ
Do While Not .EOF
If .AbsolutePosition > 0 Then
StepLine = StepLine & " : " & SQ("Description")
Else
StepLine = SQ("Description")
End If
.MoveNext
Loop
End With
SQ.Close
Set dbs = Nothing
Pivot_Steps = StepLine
Exit Function

Pivot_err:
MsgBox Error$ & Erl & "Line: " & Erl, vbCritical, "Ooops, something died!"
Exit Function

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top