[AccessD] Practical way to handle non-standard length "long text" fields
Bill Benson
bensonforums at gmail.com
Thu Mar 7 09:38:35 CST 2024
gross!
On Thu, Mar 7, 2024 at 9:25 AM John Colby <jwcolby at gmail.com> wrote:
> LOL one of my favorite sayings - "Wish in one hand and spit in the other.
> See which one fills up faster."
>
> Given which fills up faster, of course I would suggest a class but we all
> know where that would go. Something about hammers IIRC.
>
> Would you like me to build a class for you?
>
> On Thu, Mar 7, 2024 at 8:50 AM Ryan Wehler <wrwehler at gmail.com> wrote:
>
> > Thanks Rocky!
> >
> > I guess my wish was that Access read in the field length for fields like
> > this and applied that more gracefully.
> >
> >
> >
> >
> > On Wed, Mar 6, 2024 at 3:00 PM Rocky Smolin <rockysmolin2 at gmail.com>
> > wrote:
> >
> > > Ryan:
> > >
> > > I don't know of a good way to handle this. I have used KeyDown to good
> > > advantage when I wanted to inspect every keystroke in a text field. But
> > > it's a little kludgey.
> > >
> > > Two ideas: I believe if you use the input mask property to allow a
> > textbox
> > > to take a maximum number of characters. It will not allow any more
> > > characters than that input mask allows. So at 500 characters no more
> > input
> > > would be accepted. But that won't generate a message to the user. And I
> > > don't know if you can input mask a text box to limit to that high of a
> > > number of characters.
> > >
> > > A second thought would be to accept the data into an unbound text box
> and
> > > in the Lost Focus event, test for the length of the string that was
> > input -
> > > copy it to the bound text box if shorter than your Max length, or give
> a
> > > message to the user that their entered text was too long and then shift
> > the
> > > focus back to the unbound text box.
> > >
> > > HTH
> > >
> > > r
> > >
> > >
> > >
> > > On Wed, Mar 6, 2024 at 7:01 AM Ryan Wehler <wrwehler at gmail.com> wrote:
> > >
> > > > Is there any practical way to handle non-standard VARCHAR(MAX) "long
> > > text"
> > > > fields in access?
> > > >
> > > > If I set one to VARCHAR(500), Access still treats it as Long
> Text(MAX)
> > > and
> > > > the user doesn't really know it's going to be a problem until they
> exit
> > > the
> > > > field and an error pops up.
> > > >
> > > > Ideally what I'd like is for access to just stop typing as it it
> would
> > if
> > > > you hit the char limit for the field. Is there a way to do that
> > without
> > > > using OnChange or KeyDown events to count characters up and warn the
> > > user?
> > > > --
> > > > 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
> >
>
>
> --
> John W. Colby
> Colby Consulting
> --
> 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