Show column value from lookup field

emmafa

New member
Local time
Today, 09:01
Joined
Nov 11, 2010
Messages
3
I am creating a custom report where that shows values from a specific table.
One of the fields in the table is a lookup field, containing two columns (ID and CompanyName from a query). I want to display the name in the report but it shows the ID instead. The data is retreived by an sql-query.

The lookup table field
lookupfield table.JPG

The code where I assign the table field to the report
Code:
For i = 0 To rs.Fields.Count - 1
   Set tbColumnValue = CreateReportControl(...)
   tbColumnValue.ControlSource = rs(i).Name
   ...
Next i
where rs is the record set

And the resulting report.
report.JPG

I want the report to show the name instead of the ID, how do I do this?
 

Users who are viewing this thread

Back
Top Bottom