Checking if value on subform equals a value on mainform in a textbox

andy_dyer

Registered User.
Local time
Today, 19:16
Joined
Jul 2, 2003
Messages
806
Hi,

As my title suggests I have a main form (frmProject) and a subform (frmRevenueTypes)

On my frmProject I have a field called Total Value2 and on my subform a number of fields and then a field that totals them all called Total...

I then have a textbox where i want to get the form to check whether they match (as they should do as this is just a breakdown of the total)

The code I have in the textbox control source is:

=IIf([Total]=frmProject![Total Value2],"Y","N")

At present all I get is "#Name?" in the textbox...

I would like it to show a Y if they match and a N if they don't...

Going on I'd like to generate a message box to handle the error if they don't match but one step at a time...

Any ideas????
 
On which form do you have the third textbox, frmProject or frmRevenueTypes?
 
On which form do you have the third textbox, frmProject or frmRevenueTypes?

At present it is on the frmRevenueTypes but it could be moved if it makes things simplier...

Thanks for your help!
 
Hi - I've worked it out (just didn't know what to search for!)

=IIf(([Total]=parent![Total Value2]),"Y","N")

Thanks for making contact!
 

Users who are viewing this thread

Back
Top Bottom