D
Dennis
I need some help with a query in a report. I have values
that tell what time medication is to be taken. QAM = AM,
QPM=PM, QHS=HS (HS means hour of sleep) BID=ID (That means
both AM and PM) and TID (that means three times a day AM,
PM, & HS). What I am doing now is making a control in my
report for each field (QAM, QPM, QHS, BID & TID) and by
placing the QAM (report control) next to QPM (report
control) next to QHS (report control) I can get the report
to print the time of medication. All three if need be. The
problem is I have two more values BID that reports AM and,
PM, which is more than just AM or PM in one control and
TID that prints all three AM, PM, HS in one control. To
get any and all possible combinations I have to overlay
the controls and of course, they do not line up exactly if
the values are superimposed over each other. The question
is in my query, how can I get an IIf statement or other to
print any or all AM, PM or HS based on values from five
different fields in one control? I tried MED: IIf([AM]
="AM" & [PM]="PM" & [HS]=Null & [BID]=Null & [TID]
=Null,"AM PM");... and so on until all possible
combinations are covered but although I get no errors, I
do not get a solution or result. I think "&" is not
correct in an expression?
I also think I may not be able to add this statement in
the report's query SQL as I already have the following:
SELECT DISTINCT PillLine1qry.CDC_NBR, PillLine1qry.LNAME,
PillLine1qry.UNIT, GetSig([CDC_NBR],"QAM") AS AM, GetSig
([CDC_NBR],"QPM") AS PM, GetSig([CDC_NBR],"QHS") AS HS,
GetSig([CDC_NBR],"BID") AS AMPM, GetSig([CDC_NBR],"TID")
AS AMPMHS, IIf([AMPM]="ID","AM PM") AS BID, IIf([AMPMHS]
="ID","AM, PM, HS") AS TID
FROM PillLine1qry
WHERE (((PillLine1qry.UNIT) Between [Start Building ie
B01] And [Ending Building Plus One]) AND ((Right
([SIG1],3)) In ("QAM","QPM","QHS","BID","TID")))
ORDER BY PillLine1qry.LNAME;
Can I do something like this in the form control and if so
how?
What do you think?
Dennis
that tell what time medication is to be taken. QAM = AM,
QPM=PM, QHS=HS (HS means hour of sleep) BID=ID (That means
both AM and PM) and TID (that means three times a day AM,
PM, & HS). What I am doing now is making a control in my
report for each field (QAM, QPM, QHS, BID & TID) and by
placing the QAM (report control) next to QPM (report
control) next to QHS (report control) I can get the report
to print the time of medication. All three if need be. The
problem is I have two more values BID that reports AM and,
PM, which is more than just AM or PM in one control and
TID that prints all three AM, PM, HS in one control. To
get any and all possible combinations I have to overlay
the controls and of course, they do not line up exactly if
the values are superimposed over each other. The question
is in my query, how can I get an IIf statement or other to
print any or all AM, PM or HS based on values from five
different fields in one control? I tried MED: IIf([AM]
="AM" & [PM]="PM" & [HS]=Null & [BID]=Null & [TID]
=Null,"AM PM");... and so on until all possible
combinations are covered but although I get no errors, I
do not get a solution or result. I think "&" is not
correct in an expression?
I also think I may not be able to add this statement in
the report's query SQL as I already have the following:
SELECT DISTINCT PillLine1qry.CDC_NBR, PillLine1qry.LNAME,
PillLine1qry.UNIT, GetSig([CDC_NBR],"QAM") AS AM, GetSig
([CDC_NBR],"QPM") AS PM, GetSig([CDC_NBR],"QHS") AS HS,
GetSig([CDC_NBR],"BID") AS AMPM, GetSig([CDC_NBR],"TID")
AS AMPMHS, IIf([AMPM]="ID","AM PM") AS BID, IIf([AMPMHS]
="ID","AM, PM, HS") AS TID
FROM PillLine1qry
WHERE (((PillLine1qry.UNIT) Between [Start Building ie
B01] And [Ending Building Plus One]) AND ((Right
([SIG1],3)) In ("QAM","QPM","QHS","BID","TID")))
ORDER BY PillLine1qry.LNAME;
Can I do something like this in the form control and if so
how?
What do you think?
Dennis