refer one record to table with relationship in form

inspector-71

New member
Local time
Today, 00:12
Joined
Jun 2, 2010
Messages
9
I have two tables called [ncr table] and [actions]. These have a relationship defined by [ncr code]

I have a form open, also called [ncr table] which I have got a text box on which I have set up with condintional formatting.

What i want to do is for this text box to chage colour if my record from the table [NCR table] which is shown in the continuous form [NCR table] has any associated records in the [actions] table (or even better is there is anything in the [action description] field in the [actions] table.

Hope this makes sense, thanks for the help.
 
I know how to do the conditional formatting, just not what code to use in it when referring from a table in one form to a different related table
 
Do you know how to use a DCount() function?

http://www.techonthenet.com/access/functions/domain/dcount.php

1. Put the DCount function as the control source of a hidden and unbound textbox on your form. Use the DCount to return a count of how many records are present in the other table. Maybe call this text box txtMyCondition
2. Set the Conditional Formatting on your main text box
3. Ensure the Back Style property of your main text box is set to Normal
4. For the Conditional Format you will use EXPRESSION IS with a condition like:

txtMyCondition.Value <> 0
 
Last edited:

Users who are viewing this thread

Back
Top Bottom