[AccessD] Converting table data to Expression?

Rocky Smolin rockysmolin2 at gmail.com
Wed May 19 07:50:11 CDT 2021


In that case, make All mandatory fields' backcolor a noticeable color - I
like bright yellow - on opening the form or starting a new record.  And of
course because they'll eventually try to save a record without doing all
the fields, it's our job to check for yellow fields and issue a message
"You have not completed all the mandatory fields. Have some coffee and try
again".

r

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

> Well the issue is sometimes they skip some of the “required” fields all
> together. So when they don’t enter the field at all, no after update event
> can fire.
>
>
>
> Sent from my iPhone
>
> > On May 18, 2021, at 9:40 PM, Rocky Smolin <rockysmolin2 at gmail.com>
> wrote:
> >
> > Conditional formatting won't, IIRC, work on an unbound text box.  But
> could
> > you run the rule on that box in the after update event of the text box?
> >
> > AFAIK, you can't conditionally format the rows in a cmbo box.  But
> here's a
> > couple of alternative ideas:
> >
> >
> https://social.msdn.microsoft.com/Forums/sqlserver/en-US/3f9ea9e1-dd25-4550-b632-4c4af9e62c2b/conditional-formatting-of-combo-box-text-access-2010?forum=accessdev
> >
> > HTH
> >
> > r
> >
> >
> >
> >> On Tue, May 18, 2021 at 6:57 PM Ryan W <wrwehler at gmail.com> wrote:
> >>
> >> Yeah the rules would be in their own table. I didn’t think about
> >> conditional formatting but I’ll have to see if it works on forms. I know
> >> I’ve used it on datasheets but to my recollection never forms text or
> combo
> >> boxes.
> >>
> >> And yeah the idea is to highlight client specific “requirements” at the
> >> time of data entry.
> >>
> >> Jim’s example gave me something to ponder about.
> >>
> >>
> >> Sent from my iPhone
> >>
> >>> On May 18, 2021, at 7:51 PM, Rocky Smolin <rockysmolin2 at gmail.com>
> >> wrote:
> >>>
> >>> 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
> >>>>
> >>> --
> >>> AccessD mailing list
> >>> AccessD at databaseadvisors.com
> >>> https://databaseadvisors.com/mailman/listinfo/accessd
> >>> Website: http://www.databaseadvisors.com
> >> --
> >> AccessD mailing list
> >> AccessD at databaseadvisors.com
> >> https://databaseadvisors.com/mailman/listinfo/accessd
> >> Website: http://www.databaseadvisors.com
> >>
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> --
> 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