Re: several simple questions about text boxes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Albert D. Kallal (pleasenonosspammkallal_at_msn.com)
Date: 04/12/04


Date: Sun, 11 Apr 2004 21:21:24 -0600


"Kevin S." <kseitz@gbronline.com> wrote in message
news:od2dnSa8kN0Qn-fdRVn-tA@gbronline.com...
> I'm not the brightest MS Access user, so I need a little help.
>
> Question #1
>
> Lets say I have 5 text boxes that hold 5 characters each, like if you were
> entering a serial key into a setup program. Once 5 characters are entered,
> how can I make the cursor go to the next text box?

In the table design mode..make the field 5 chars. Then, in the forms
designs, set the text control to "auto tab". (this setting is in the
other...and will make the cursor jump when the end of text box is hit). If
your text box is un-bound..I believe auto tab will also work if you use a
input mask (and thus don't have to rely on the table field length setting).

>
> Question #2
>
> Code to determine length of a text string in a text box?

The answer depends on WHEN you need to get the length of the string. In the
after update event...the text has been moved into the text box value. So you
can go:

msgbox "the length of the field is" & len(me!MyContorlBoxName.value)

Note that "value" is the default..so often we use:

me!MyContorlBoxName

However, if you are using a event like keydown..then the focus, or even an
attempt to move off the control HAS NOT occurred. This means that the
"value" of the control has NOT yet had a chance to be updated. In this case,
you must use the .text property. Of course..the .text property ONLY works
when the control has the focus
>
> Question #3
>
> Let's say I want to pull out the third character of any word, such as my
> name..Kevin...... is there something better than
> using.........right(left(text0,3),1)......or is that good enough?

I use the mid function.

msgbox "The 3rd char you typed is " & mid("yourtext",3,1)

>
> Question #4
>
> This one is less important, so if there isn't an easy answer, don't bother
> with it. I know storing passwords in a table in MS Access is unsecure.
Just
> import the table and remove the mask. However, is their an easy way to
> convert the whole password to something less obvious? Like encrypting it
or
> something? And how can I change it back?

Hum, you make up your own munch and crunch routine. You could take each
character, and convert it to something else

dim strPass as string

strPass = "hello"

for i = 1 to len(strPass)
   c = mid(strPass,i,1)
   cval = asc(c)
next i

cval will be the actual ASCII number of the single character. You could add
your own routine that divides...or perhaps even squares the number. You then
take the square root to get your original number back (so, save each char as
a number seperated by comma..and the you can reverse it).

--
Albert D. Kallal        (MVP)
Edmonton, Alberta Canada
pleasenonoSpamKallal@msn.com
http://www.attcanada.net/~kallal.msn


Relevant Pages

  • Re: Got UART Working!!! need syntax help with using ascii/buffer scheduling.
    ... it will use the character currently pointed to ... hardware and this is a description of the transmit holding register ... individual characters in the string is to use an index. ... characters, you can control that. ...
    (comp.arch.fpga)
  • Re: Using print with format to stdout generates unwanted space
    ... While printfdoes tightly control formatting in C, ... > converted to a string using the rules for string conversions. ... > characters have yet been written to standard output, ... > character written to standard output is "\n", or when the last write ...
    (comp.lang.python)
  • Re: Replace a charater with a carriage return
    ... string together in the text box control source, ... section of the report the text box is in. ... ABC then a cube shaped character then EFG all on the same line. ...
    (microsoft.public.access.formscoding)
  • Re: Calculating the width of a Winforms control
    ... what character would you recommend I use to fill my "sizing" string. ... almost every font. ... So if my input is 6 characters, I could size my control ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: OpenVMS 5.5 shared folder on a windows network ?
    ... drivers do not give you control over these parameters (when the control is ...  The delay overhead of the USB isn't due the minimum "interrupt ... I understand the antique designs that required seeing the character "echo" ... The fact that parallel printer ports weren't designed to do simple ...
    (comp.os.vms)