Validation msg when exiting a control

H

hlock

I've been working on this too long with my limited knowledge of programming.
I tend to get stuck on something until I figure it out, but this is driving
me crazy!

I have a form called [Invoices] and a subform called [Invoices Paid
Subform]. They are linked together by a unique invoice identifier. Multiple
entries on the subform can be made for each invoice entered on the main form.
I also have a totals query called [Q: Totals by Claimant] that groups each
[claimant #] and sums [sumamtpd] for each claimant #.

On the subform, the first control is a combo-box called [Claimant] with two
fields that pull from the table called [Claimant Info]. These fields are
[Claimant #] and [claimant name]. The first field is stored.

What I would like to happen is when a user selects a claimant # in the
[Claimant]control on the subform, the macro or code will "match" the value of
the [Claimant] control in the subform to [Q: Totals by Claimant].[claimant
#], then check if [sumamtpd] > 2500.

If [sumamtpd] > 2500, I need a message box to appear when the user exits the
combo-box control that states "The deductible has been exceeded on this
claimant. Please choose another claimant." If [sumamtpd] <=2500, the user
should be able to continue on with the entry. I've tried macro and code, but
keep getting a message that states "The object doesn't contain the Automation
object".

Any help would be appreciated. If you need additional information, let me
know.
 

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

Top