HELP!!! Validation rule

message from Chris on 30 May 2004
I have to introduce in a table some data, using a form with contrtols: combo
boxes and text boxes. The fields need to follow some VALIDATION RULES, and
to display the VALIDATION TEXT as the error message.
The validation rules must to fields from a query, because the that table is
used to extract items from a storage and it musn't contain data that was not
entered (that query representing the state of the storage at that moment).
How can I do this thing?
Please, help me! I'm stucked.
 
Chris replied to Chris on 31 May 2004
I have to introduce in a table some data, using a form with contrtols: combo
boxes and text boxes. The fields need to follow some VALIDATION RULES, and
to display the VALIDATION TEXT as the error message.
The validation rules must REFER to fields from a query, because the that
table is
used to extract items from a storage and it musn't contain data that was not
entered (that query representing the state of the storage at that moment).
How can I do this thing?
Please, help me! I'm stucked.
 
John Nurick replied to Chris on 31 May 2004
Hi Chris,

If you're storing your data in a Jet database (an .mdb file) you can't
do this at the table level. Instead, put your validation code in event
procedures of the form and its controls. Typically, validation for a
single field would be in the corresponding control's BeforeUpdate event,
or validation for the entire record in the form's BeforeUpdate event.

On Sun, 30 May 2004 01:37:08 +0300, "Chris" <1@2.de> wrote:
 
Chris replied to John Nurick on 1 Jun 2004
Textbox:DATA; cmbbox ID_material; cmbbox ID_dimensions; cmbbox
ID_Quality; Textbox Quantity, cmbbox UM (kg, m, or pieces); Texbox
UnitPrice; cmbbox MonetarUnit; CmbBox ID_order; textbox ProductCode;
Textbox UnitsOfProduct

These record must not contain data not entered. The entered data (totalized
by categories) is represented by the query:

SELECT DISTINCT [stoc1-0].Mat_Code, [stoc1-0].Material,
[stoc1-0].Dimensions, [stoc1-0].Quality, Sum([stoc1-0].[Length(m)]) AS
[SumOfLength(m)], Sum([stoc1-0].[Quantity(kg)]) AS [SumOfQuantity(kg)],
Sum([stoc1-0].[Quantity(pieces)]) AS SumOf[Quantity(pieces)],
[stoc1-0].ID_material, [stoc1-0].ID_Dimensions, [stoc1-0].Cod_Calit,
[stoc1-0].UM, [stoc1-0].UnitPrice, Sum([stoc1-0].[TotalPrice]) AS
[SumOfTotalPrice], [stoc1-0].[Price(euro)],
Sum([stoc1-0].[TotalPrice(euro)]) AS SumOf[TotalPrice(euro)]
FROM [stoc1-0]
GROUP BY [stoc1-0].Material_Code, [stoc1-0].Material, [stoc1-0].Dimensions,
[stoc1-0].Quality, [stoc1-0].ID_material, [stoc1-0].ID_Dimensions,
[stoc1-0].Cod_Calit, [stoc1-0].UM, [stoc1-0].UnitPrice,
[stoc1-0].[Price(euro)]
ORDER BY [stoc1-0].Material, [stoc1-0].Quality, [stoc1-0].Dimensions;

(Mat_code is : Format([id_material];"000") & Format([id_dimensions];"000")
& Format([ID_Quality];"000")

Can you help me ?
How can I validate in this situation the entire record in the BeforeUpdate
event? Or how can it be made for every field?
I would apreciate your help.

"John Nurick" <j.mapSoN.nurick@dial.pipex.com> wrote in message
news:hn1mb09a623rrflad0b87aukl1nt0occ53@4ax.com...
 

Archived message: HELP!!! Validation rule (MS Access Database)