Re: Format and Inputmask Problem

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

From: David Frankenbach (sendnospam_at_sendnospam.net)
Date: 03/13/05

  • Next message: Carol Crow: "2 quickie ?'s"
    Date: Sun, 13 Mar 2005 12:25:48 -0600
    
    

    Bill,

    L and X are valid input mask characters so they can't be part of your static
    text.

    Can you more simply set this up as 4 textboxes to gather each of the numeric
    regions of the value? You can't directly bind to the table field, but you
    can easily seperate the field into the 4 controls and gather it back
    together at save time. You can put 3 label objects -RE -CL and -EX between
    the textboxes.

    If 4 seperate textboxes look too odd, I think you can get 7 textboxes put
    together to look like one by setting their BorderStyle = 0 (none) then
    position them right against each other. Your three static textboxes can have
    a When() that returns .f. so that focus will never get there, and set the
    Value = "-RE" etc. on the property sheet and size the Width appropriately.

    -- 
    df - Microsoft MVP FoxPro    http://www.geocities.com/df_foxpro
    "Bill Leavy" <bleavy@optonline.net> wrote in message 
    news:5gm331hedq4uli8k2l291f8f2rvs9gvl8f@4ax.com...
    > Hi Folks -
    >
    > I have a data field of 12 characters that contains a series of
    > numbers.  I want to show the field on a form with the numbers in a
    > specific format and have been unable to make it work with the input
    > mask and format properties.
    >
    > All 12 numerical characters should appear separated by hyphens and
    > some letter codes that are not stored (so I'm trying to use the "R"
    > formatting code.
    >
    > The format should be "999999-RE99-CL99-EX99" where the 9s are
    > numerical characters from the field and the hyphens and alpha
    > characters would be persistent.
    >
    > For example...
    >
    > a field with a value of "123456789012"
    >
    > should display as "123456-RE78-CL90-EX12"
    >
    > If I use "R" in the format property and "999999-RE99-CL99-EX99" in the
    > input mask, it yields "123456-RE78-C901-E2"
    >
    > In other words, it picks up the hyphens and the RE, but misses the L
    > in CL and the X in EX.
    >
    > I know I can manually concatenate it together, but I need to have the
    > user be able to edit the numerical part only it on a form.
    >
    > Is there a way of accomplishing what I want?
    >
    > Thanks to anyone that can help.
    >
    > --  Bill
    >
    > 
    

  • Next message: Carol Crow: "2 quickie ?'s"

    Relevant Pages

    • Re: Data Validation for TextBoxes
      ... that method will not prevent users from pasting in "invalid" characters. ... Private Sub TextBox1_MouseDown(ByVal Button As Integer, ... Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) ... Also, how can I do it for many TextBoxes, ...
      (microsoft.public.excel.programming)
    • Re: Change textbox color based on matching value in different textbox
      ... the textboxes' background color to black. ... and so I need to exclude it from the loop) to black if the leftmost ... characters of their contents match the leftmost two characters in the ... checker textbox. ...
      (microsoft.public.access.formscoding)
    • Win32: C: Chinese language inputting improperly in text box. Extremely strange bug, please help!
      ... entering chinese ... up and puts random characters int he textbox (sometimes '?', ... For me to reproduce the symptom, i click inside the textbox, with IME ... copy those, and paste into my suspect textboxes, they show up FINE. ...
      (comp.lang.c)
    • Re: everything after character is not displayed
      ... I have been getting strange behaviour when using ' in by textboxes. ... area type is ok ... this does not happen with other characters such as " or / ...
      (comp.lang.php)
    • Re: Maximum Characters per Website
      ... Hilfe & Infos rund um den ISA Server: http://www.msisafaq.de ... form I have created a website where you can fill out this form. ... of Characters in all the textboxes. ... but I can only add as many characters as I delete. ...
      (microsoft.public.dotnet.framework.aspnet)