Setting checkbox state thru code

  • Thread starter Thread starter RipperT
  • Start date Start date
R

RipperT

I want to place a checkbox on a report and have it show checked/unchecked
based on the existence of a record in a table with certain criteria. In the
checkbox's control source I have put

=IIf(IsNull(DLookup("[InmateID]", "tblSegregation", _
"([InmateId] = '" & .InmateID & "') AND ([ReleaseDate] Is Null) AND
([SegType] = 'Admin Seg')")), True, False)

but this doesn't work. What is the best way to accomplish this?

Thanks to all who can help.

Ripper
 
hi,
I want to place a checkbox on a report and have it show checked/unchecked
based on the existence of a record in a table with certain criteria. In the
checkbox's control source I have put

=IIf(IsNull(DLookup("[InmateID]", "tblSegregation", _
"([InmateId] = '" & .InmateID & "') AND ([ReleaseDate] Is Null) AND
([SegType] = 'Admin Seg')")), True, False)
I think it's the .InmateID, try this instead:

=(DCount("*",
"tblSegregation",
"InmateId = '" & [InmateID] & "' AND " &
"IsNull(ReleaseDate) AND " &
"SegType = 'Admin Seg'") <> 0)


mfG
--> stefan <--
 
Back
Top