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

The code where I assign the table field to the report
where rs is the record set
And the resulting report.

I want the report to show the name instead of the ID, how do I do this?
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

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
And the resulting report.

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