102k views
5 votes
If you wanted to set up a rule to tell the database that the value in the field SaleDate must come before the DeliveryDate, you would set the condition in the data macro for this form to ________.

1 Answer

5 votes

Final answer:

To set up a rule in a database table to ensure that the value in the field SaleDate comes before the DeliveryDate, you can use a validation rule in the data macro for the form.

Step-by-step explanation:

To set up a rule in a database table to ensure that the value in the field SaleDate comes before the DeliveryDate, you can use a validation rule in the data macro for the form. In the data macro, you would write a condition that checks if the SaleDate is less than the DeliveryDate. If the condition is not met, an error message can be displayed to the user.

Here's an example of how the condition might look like in a data macro:

IF [SaleDate] >= [DeliveryDate] THEN
SetField([ErrorCode], 1)
SetField([ErrorMessage], 'Sale date must be before delivery date')
END IF

In this example, if the SaleDate is greater than or equal to the DeliveryDate, the [ErrorCode] field is set to 1 and the [ErrorMessage] field is set to 'Sale date must be before delivery date'.

User Piet Van Dongen
by
7.8k points