[AccessD] Converting table data to Expression?

Rocky Smolin rockysmolin2 at gmail.com
Tue May 18 19:50:36 CDT 2021


If it's the display of the validated data that you need I would bind those
fields to a form and use conditional formatting which I believe you can
manipulate with code. Instead of putting the rules in the same table with
the data I would put all of your rules in a rules table with table name,
field name, and rule, and allow those rules to be set by the user through a
nice restrictive UI so they can roll their own without having to go to IT
for every rule change.

r

On Tue, May 18, 2021 at 12:53 PM Ryan W <wrwehler at gmail.com> wrote:

> Does anyone know how to convert table data to an expression?
>
> For example:
>
> I want to make a table called TBL_ValidationRules
>
> Columns:
>
> Client
> Field
> Eval_for
>
> so say Client A REQUIRES Field B to be NOT NULL.
>
> So the data would be
> Client: A
> Field: B
> EVAL_FOR: NULL
>
> So with a button press on a form the code would loop through the recordset
> for the current record/client in question and highlight or colorize Field B
> if the field is null.
>
> I can't use Table or Form validation rules for this because they change
> from client to client and sometimes the end user doesn't even ENTER a field
> for a validation rule to fire on it... so I was just thinking of I had a
> way for my data entry people to click validate (or have it validate on
> close/new record) and highlight the deficiencies that would be really cool.
>
>
> So my question is how would I go about turning the text in the Eval_For
> data into the expression eg:
>
> if me(rst!Field) = rst!Eval_For then me(rst!Field).BackColor=#999999
>
>
> where obviously rst!Eval_for is somehow turned into NULL (so expression
> reads:
> if me(rst!Field) = null then ..... .
>
> Unless you fellas have a better idea?
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list