Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help on Yes, No, Unknown on the same record... 1

Status
Not open for further replies.
Feb 4, 2009
137
US
Hello, I need help on these checkbox when there’re a value in the table.
This is my subreport linked with PatientNo. I want to show the initial begin date only. So on the subreport, I have to groupby PatientNo, second groupby BeginDate.

These are example of my table. (tablename: tableRX)

Patient_no Begin_date Rx

1130920 11/3/2010 INH
1130920 11/3/2010 RIF
1130920 11/3/2010 EMB
1130920 11/3/2010 PZA
1130920 11/3/2010 B6
1130920 11/19/2010 INH
1130920 11/19/2010 RIF
1130920 11/19/2010 EMB
1130920 11/19/2010 PZA
1130920 11/19/2010 B6


On my subreport I would like to show something like this on this patientNo

BeginDate: 11/3/2010
Yes (checkbox) No (Checkbox) Unknown(checkbox)

INH X
RIF X
LEV X
PZA X
PAS X
RIP X
OFL X
EMB X
GAT X
B6 X

If the patient doesn’t have any record then the Unknown box should be checked. Please help.
I created some formula fields such as @INH_Yes, @INH_No, @INH_UNK and etc…
For instance:
@INH_Yes
If ({tableRX.RX}) = "INH" then "X" else " "
This is working fine on the “Yes checkbox) , but not on the “No Checkbox”
@INH_No:
If ({tableRX.RX}) <> "INH" then "X" else " "
And I don’t know how to do on the @INH_Unknown
And same things to the other formula fields (@PZA_Yes, @PZA_No, @PZA_Unknown, etc…)

Please help, I'm very appreciated. Again, thank you very much.
 
It sounds like you have a standard list of medications that you are checking. One way would be to create one formula for each medication like this:

//{@LEV}:
if {tablerx.rx} = "LEV" then "X"

//{@INH}:
if {tablerx.rx} = "INH" then "X"

Place these in the detail section and insert maximums on them. Suppress all subreport sections except the report footer and then add text boxes identifying the medications and then in the Yes column move the maximums you earlier inserted into a "Yes" column. Then create a second set of formulas, one for each medication:

//{@NoLEV}:
if maximum({@LEV}) = "" then "X"

Place these in the "No" column. For the unknown column, use:
//{@Uk}:
if isnull({tablerx.rx}) then "X"

...but I think this latter formula will only work as long as you have not formatted the subreport to "suppress blank subreport" and if in the subreport->file->report options you have not checked "suppress printing if no records".

This may not be the best approach if the list of medications is long or if it changes.

-LB
 
Thanks lbass for your response, but only the Yes formulas working. The No and Unknown don't show anything, it just blank...and I did exactly what you told me.

First on my subreport, I have 2 group (patientNo and begindate). Suppress all subreport sections except report footer. place all formulas on this section.

for instance INH med:

@INH_Yes: if {tablerx.rx} = "INH" then "X"
@INH_No:if maximum({@INH_Yes}) = "" then "X"
@INH_Unknown: if isnull({tablerx.rx}) then "X"

In the subreport->file->report options I unchecked "suppress printing if no records".
and on the main report, on subreport...>format subreport, on subreport tab. I don't have "Suppress blank subreport" checked.

But seems like all no and unknown checkbox don't work.
please help.
Thanks again.
 
My bad...It's working lbass. Thank you very much for you help. I run the subreport itself,it's not showing the results on NO and UNKNOWN checkbox, but when I run the main report, it's showed all and working correctly. Again, thanks alots.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top