I have a report that displays data from a flight schedule. The flight schedule has a primary key- MSN. In the same report I need to display data from another table in a very specific format. The data from the second table (Arial refuels, AR) is related through the primary key MSN and may have multiple instances in this table. So for instance if the flight schedule with MSN # 1 has 3 records in AR table, I need them to display in a single text box one after another stacked vertically. like this :
03/23/55/34/
23/54/23/56/
85/345/23/14
Each row represents the entire record that had a matching MSN of 1.
I am able to do this but with only one record. Either the first or the last.
My first method which would work if there were only one AR per flight is to bind the variables inside the text box on data view like this : =[var1]&"/"&[var2]&"/"&[var3]&"/"&[var4]&"/"&.
My second attempt was to loop through the recordset and add a string with a new line character at the end but this result in only showing the last of the records.
Do While Not rs.EOF
op = CStr(rs!var1 &"/"& rs!var2 &"/"& rs!var3 &"/"& rs!var4 & vbCFLf)
Me.TxtAR.Value = op
rs.MoveNext
Loop