Scotto123
asked on
Count Related Records in other Table and if >1 change control
I want to populate a control (not bound) on my continuous form when there are records in a different table.
I've gotten this far but need help making the control change.
DLookup("Count(*)", "[BoardComments]", "[BoardID] = " & Me.BoardID)
Something like this?
If
DLookup("Count(*)", "[BoardComments]", "[BoardID] = " & Me.BoardID)>0
Then
me.CommentsYes=1
Else
me.CommentsYes=0
End If
Doesn't like that. Suggestions?
I've gotten this far but need help making the control change.
DLookup("Count(*)", "[BoardComments]", "[BoardID] = " & Me.BoardID)
Something like this?
If
DLookup("Count(*)", "[BoardComments]", "[BoardID] = " & Me.BoardID)>0
Then
me.CommentsYes=1
Else
me.CommentsYes=0
End If
Doesn't like that. Suggestions?
If you use an unbound control, every record will show the same value as derived from the current record. You cannot show different values in different records.
ASKER
That's why I'm using the Dlookup to lookup the BoardID from the current record.
Still won't work?
Still won't work?
ASKER
I see your point Peter. So if I bound the control to the table, how would the code look?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Examine Pete's suggestion first.
For strictly informational purposes, here is something similar I did for another similar question
(If a Customer had Orders)
Database34.mdb
For strictly informational purposes, here is something similar I did for another similar question
(If a Customer had Orders)
Database34.mdb
ASKER
I will work on this when I get back to work on 9/3. I will take both solutions into consideration. Thank you.