Concatenate several fields

Gannet

Registered User.
Local time
Today, 12:54
Joined
Sep 21, 2006
Messages
55
I'm not sure if this can be done in a report but I want to take several fields in a table and list them in a single text box.

For example (since all the fields are Y/N):

Fields_____Value_____Value I want displayed
ID________11-111111___11-111111
rr_pain________Y________Pain
rr_infection____Y________Infection
rr_headache___N________Headache
rr_rash________Y________Rash

*Since headache is checked N then it will not be shown.

Final Report view
ID________________RR_Text
11-111111________Pain, Infection, Rash
22-222222________some other combination

This will need to be done for each "ID" in my report
 
you need to test the yes/no and use if rr_pain = true then Add it to a string varable so each one only gets added to the sting if true then assign it to a control once the full string is built

Sorry I think you might need to put the code in the on format event, Going Off line as to tired to be of much use hopefully somebody else will get you a better answer Sorry

mick
 
Last edited:
I tried checking the value of each field and that is where I ran into errors.

The only event in reports I thought I could use for this code was OnOpen and everytime I try to reference a field that is included in the control source it give me an error.
 
I'd just put it in the query, but if you want to code it in the report the format event of the section containing the textbox would be the place, not the open event.
 

Users who are viewing this thread

Back
Top Bottom