Combo box output to reports (1 Viewer)

MaleNurse325

Registered User.
Local time
Yesterday, 23:31
Joined
Jan 11, 2016
Messages
67
I have a report based on the information from a combo box on the data input form. The combo box has an associated numerical score that is necessary to calculate risk factors, as well as text for the user to select the appropriate risk. the 'score' is in column 1 of the combo box with the width set at 0. The selections are in a separate table to the input form.
The calculations on the form function well but...

When I try to produce a report of the information from that record I get the associated 'score' I would like to be able to convert that score back to the associated text in the table.

I could make this nested iff or switch statements, but this project will have to be used at more than 20 locations and some of the table data will be bespoke to the locations.

Is there a more simple way of referring the field on the report back to the table?



:banghead:
 

Ranman256

Well-known member
Local time
Today, 02:31
Joined
Apr 9, 2015
Messages
4,337
if the combo has the correct value for the query, use the combo in the report query:
select * from table where [score]=forms!myForm!cboBox

if want a different value then what is chosen in the combo box, swap out the bound column to the correct column value.

if you want the query to pull MANY values, then you cannot use a combo box, I would use a listbox and let the user pick the various values.
Store these picked values into a 'picked' table, join this table to the data table and the query will pull only these.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:31
Joined
Aug 30, 2003
Messages
36,125
You can put a combo on the report with the same settings, or base the report on a query that joins the two tables together, enabling you to return the text field. The second is probably most common.
 

Users who are viewing this thread

Top Bottom