Results 1 to 11 of 11

Thread: Input masks

  1. #1
    Join Date
    May 2004
    Posts
    80

    Unanswered: Input masks

    Is there any way to set an input mask so that you can enter ANY character excluding digits, but including hyphens and spaces?

    For example, if somebody has a hyphenated surname, using the input mask:

    >L<??????....

    doesn't work, as it would only allow

    Jones smith (instead of Jones-Smith)

    I really need an input mask to allow capitalisation or lower case (excluding the first letter, which will automatically convert to uppercase if it is entered in lowercase). Obviously I also need some kind of symbol or code or whatever to fix the hyphen/space problem too. Any suggestions?

  2. #2
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking Input masks

    Hi graceadair,

    To see what you have, do you happen to have all of the name in ONE field? Like FirstName and LastName?? It would be best to have both and including the MiddleInitial if used all in separate fields of their own. Reason? Easier to sort by either First or Last name. If all are in one field you can't do that. In your table have a field for each, and then in the form you can create a FullName field and Concatenate the two into one like this:
    Here you go....(Field1)FirstName, (Field2)LastName.
    You need do this below in a TextBox on the form called FullName:

    Code:
    =[FirstName]&" - "&[LastName]
                         OR
    =[FirstName]&" , &"[LastName]
    You can place whatever type of separator you wish in the middle. As you can see in one I input a (-)hypen, the other I used (,) comma.
    Also, you can do this in your Query and just created a TextBox to hold that result in your form as well.

    hope this helps you,
    Bud

  3. #3
    Join Date
    May 2004
    Posts
    80

    Two separate fields, and thankyou

    Thanks for your reply...yeah, I'm speaking in terms of having a separate field for FirstName and LastName. The trouble is that the hyphenating problem is that there won't necessarily be a hyphen in all surnames entered into the LastName field, which is where I'm facing most of my problems. Obviously, for example, I might just have the surname Jones for one instance of LastName, and then for another, I'd have Jones-Smith, so there's no predefined formula or structure for the spelling of a surname. Is that what you're saying? (Sorry I'm a little bit slow at understanding intelligent things!)

  4. #4
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    it's not the best method, but you could place code in the before_update event of your text box, and then cancel the update if digits are entered. not sure how you would do it using input masks, as the number of characters before/after the hyphen are not constant, and there will not always be a hyphen

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Smile

    Quote Originally Posted by graceadair
    Thanks for your reply...yeah, I'm speaking in terms of having a separate field for FirstName and LastName. The trouble is that the hyphenating problem is that there won't necessarily be a hyphen in all surnames entered into the LastName field, which is where I'm facing most of my problems. Obviously, for example, I might just have the surname Jones for one instance of LastName, and then for another, I'd have Jones-Smith, so there's no predefined formula or structure for the spelling of a surname. Is that what you're saying? (Sorry I'm a little bit slow at understanding intelligent things!)
    Hi graceadair,

    As saila noted there is not any clear cut way that I can think of that will allow you to do just that. If the last name will sometimes contain a hyphen then I would personally just have the LastName field open enough to include whatever amount of text the user is allowed to input. Thereby if there is a name like....Johnsonisthelastname.............there is sufficient space. But also, if there is the surname instance you can just simply input......Jones-Smith. That way they can input the full last name and surname. OR for the sake of doing it in a mechanics version of doing things. FName, LName, SName (surname). Do simply as I stated before, but include the SurName field and concatenate it with the LName field. That way you input the Surname if there is one, or leave it blank. I will try to create a sample for you. So just hang in there. If I can't then maybe someone else can give you a good way also. Keep watching.

    Bud

  6. #6
    Join Date
    May 2004
    Posts
    80

    Thanks

    Thanks

    - Grace

  7. #7
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by graceadair
    Thanks

    - Grace
    Hi Grace,
    I worked on something for you last night. It is attached below, but there is a small problem with it that maybe someone can figure out. Once you input the data, the cursur halts in the last input field. To move on to the next record I have to hit the (Esc) key. I can't figure out why. But other than that Grace, it works are you want it to. You can input a name and get the full first and last name OR you can input first, surname, lastname and get that in the end. The hypen is carried over in the query I tied to the form. Check it out and see if you like it. Just open the form and type in a FirstName, SurName, LastName and see what fills in the FullName TextBox. Also, type in FirstName and LastName WITHOUT the SurName and get First and Last with NO hyphen.

    Check back with you later, gotta work some now....
    Bud
    Attached Files Attached Files

  8. #8
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by Bud
    Hi Grace,
    I worked on something for you last night. It is attached below, but there is a small problem with it that maybe someone can figure out. Once you input the data, the cursur halts in the last input field. To move on to the next record I have to hit the (Esc) key. I can't figure out why. But other than that Grace, it works are you want it to. You can input a name and get the full first and last name OR you can input first, surname, lastname and get that in the end. The hypen is carried over in the query I tied to the form. Check it out and see if you like it. Just open the form and type in a FirstName, SurName, LastName and see what fills in the FullName TextBox. Also, type in FirstName and LastName WITHOUT the SurName and get First and Last with NO hyphen.

    Check back with you later, gotta work some now....
    Bud
    Also Grace, type the names without having to hit your ShiftKey for uppercase. Already formatted it for that for you.

  9. #9
    Join Date
    May 2004
    Posts
    80

    Thank you

    Thanks heaps for your efforts, they are very much appreciated!! I really don't know what to say, but wow!

    - Grace

  10. #10
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by graceadair
    Thanks heaps for your efforts, they are very much appreciated!! I really don't know what to say, but wow!

    - Grace
    Just being able to help is enough for me. Not the smartest one on here but try to find a way to help out others when and if I can. Come back again and let's see what we can get into.

    have a nice one,
    Bud

  11. #11
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    does the form_afterupdate event fire after a control is updated? and vice versa? if so, then don't you create a loop between the form updating, and the control causing the form to requery?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •