How do you pad a value in a text box - InfoPath Dev
in

InfoPath Dev

How do you pad a value in a text box

Last post 11-20-2007 09:48 AM by Clay Fox. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-20-2007 05:55 AM

    How do you pad a value in a text box

    I think I messed up trying to explain an issue. I have a field in an ACCESS database table that is 5 characters. Not all records contain 5 characters, some contain 4.  When someone enters an AccountID containing 4 characters, it does not work, they have to enter a space at the end, So, I don't think the normalize-space function is what I need, I need to pad a space onto the value in the text box.

    Thanks

  • 11-20-2007 07:42 AM In reply to

    Re: How do you pad a value in a text box

    Hey Ed.

    Here is a way to do it.

    I think you said before it is either a 5 digit numeric or it is 4 text so I would add a condition to a new rule that says if dropdown field for account number does not equal pattern and then use zipcode, which is 5 numeric digits.  This should catch your everything that is not 5 digits. 

    Then for your rule set field and then use concat(dropdown_account_num, " ") = accountnuminlist for your filter on account name.

    Hope that helps.  - I still think you need to get this into SQL for production.

  • 11-20-2007 09:24 AM In reply to

    Re: How do you pad a value in a text box

    The value can be 5 character alpha, 4 character alpha, 2 alpha 1 numeric, 1 numeric+4 alpha, 3 numeric+2 alpha, 3 numeric....basically any possibility up to 5 characters. Will this work. I am having trouble getting the rule to work.

  • 11-20-2007 09:48 AM In reply to

    Re: How do you pad a value in a text box

    That makes it more challenging. Who came up with the account number specification?

    You could setup for each scenario and validate against characters rather than digits so you would have 4 rules. You can do the custom pattern with just characters (.)

    1 character add 4 spaces

    2 characters add 3 spaces

    3 characters add 2 spaces

    4 characters add 1 space

    Else no padding

     Have you tried in your filter Account_NumfromUserEntry = normalize-space(Accountnumfromlist)

    That should be the proper approach. That way it compares what was entered with the list value without the space.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.