Assigning value to text box

A

Andy G

offndrCount = DCount("[SSN]", "Offender")
rlgnCount = DCount("[SSN]", "Offender", "[Rlgn_ID] Is Not Null")

rlgnPrcnt = rlgnCount / offndrCount
txtRlgnPerct = rlgnPrcnt

txtRlgnPerct needs to have the value of rlgnPrcnt in it. It says I can't
assign a value to this object. Can I do this in code or should I use hidden
text boxes in the report?

Thanks,
Andy
 
D

Duane Hookom

Can you set the control source of txtRlgnPerct to:
= DCount("[SSN]", "Offender", "[Rlgn_ID] Is Not Null")/DCount("[SSN]",
"Offender")
 
A

Andy G

But that would be too easy.

Just joking, thanks Duane.


Duane Hookom said:
Can you set the control source of txtRlgnPerct to:
= DCount("[SSN]", "Offender", "[Rlgn_ID] Is Not Null")/DCount("[SSN]",
"Offender")

--
Duane Hookom
MS Access MVP
--

Andy G said:
offndrCount = DCount("[SSN]", "Offender")
rlgnCount = DCount("[SSN]", "Offender", "[Rlgn_ID] Is Not Null")

rlgnPrcnt = rlgnCount / offndrCount
txtRlgnPerct = rlgnPrcnt

txtRlgnPerct needs to have the value of rlgnPrcnt in it. It says I can't
assign a value to this object. Can I do this in code or should I use
hidden text boxes in the report?

Thanks,
Andy
 
Top