Setting checkbox state thru code

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
 
S

Stefan Hoffmann

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 <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top