Why my ValidationRule expression generates an error?

V

vukas

hello,

to solve the problem I made very simple example of my situation,
so I have:
table Table1 which consists of 2 fields - Name (text) and Number (number),

query Query1 for summarizing numbers in Number field (Name: Group By,
Number: Sum),

form Form1 based on the table Table1 with one Text Box (Control Source:
Number, Validation Rule: =[Query1]![SumOfNumber]<20)

My task is to prohibit entering numbers to the table's "Number" field if
their total exceeds 20. Every time, when I'm trying to add new record or to
modify the old one using the form, an error message appears: The expression
[Query1] you entered in the form control's ValidationRule property contains
the error The object doesn't contain the Automation object 'Query1.' The
same happens when I use Validation Macro and with all tables, queries and
forms I have made to investigate the problem.

What ValidationRule I have to supply?

Thank you!
 
J

John Vinson

query Query1 for summarizing numbers in Number field (Name: Group By,
Number: Sum),

form Form1 based on the table Table1 with one Text Box (Control Source:
Number, Validation Rule: =[Query1]![SumOfNumber]<20)

Unfortunately a field Validation Rule cannot reference any other field
in the table, or any other table.

You'll need to maintain this business rule using VBA code on a Form -
I know of no way to do so using either table or field validation
rules.
 
A

Aldo

Hi Vukas,

This operation definetly requires VBA code to be
written. If you need help on this, you may contact the
microsoft technical support.

Aldo
-----Original Message-----
hello,

to solve the problem I made very simple example of my situation,
so I have:
table Table1 which consists of 2 fields - Name (text) and Number (number),

query Query1 for summarizing numbers in Number field (Name: Group By,
Number: Sum),

form Form1 based on the table Table1 with one Text Box (Control Source:
Number, Validation Rule: =[Query1]![SumOfNumber]<20)

My task is to prohibit entering numbers to the table's "Number" field if
their total exceeds 20. Every time, when I'm trying to add new record or to
modify the old one using the form, an error message appears: The expression
[Query1] you entered in the form control's
ValidationRule property contains
 

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