Alpha Video Training
Results 1 to 24 of 24

Thread: Mask problem

  1. #1
    Member
    Real Name
    Dave Mac Callum
    Join Date
    Jan 2006
    Location
    Johannesburg. South Africa
    Posts
    383

    Default Mask problem

    Hi there,

    Have this problem.

    Am attaching a backup of Table called Banners

    Require to create a mask to control data entry on Field BANNER_ID. I have entered a Simple Mask on BANNER_ID, Field Rules, Data Entry The BANNER_ID field (10 Chars) requires to be structured as follows :

    3 x Uppercase letters
    1 x backslash /
    2 x Uppercase letters
    1 x backslash /
    3 x digits

    I have structured the mask as LLL/LL/000.

    On a test I invoke the Banners Update Form and Push Button "New Banner" Banner_Id field gets focus. I am able to enter "abcdefgh" and the system accepts this. I expect the Field Rule to force digits as the last 3 keys entered .

    Any idea what I am doing wrong ?

    Looking forward

    Dave Mac

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Mask problem

    Quote Originally Posted by Dave Mac Callum View Post
    Hi there,

    Have this problem.

    Am attaching a backup of Table called Banners

    Require to create a mask to control data entry on Field BANNER_ID. I have entered a Simple Mask on BANNER_ID, Field Rules, Data Entry The BANNER_ID field (10 Chars) requires to be structured as follows :

    3 x Uppercase letters
    1 x backslash /
    2 x Uppercase letters
    1 x backslash /
    3 x digits

    I have structured the mask as LLL/LL/000.

    On a test I invoke the Banners Update Form and Push Button "New Banner" Banner_Id field gets focus. I am able to enter "abcdefgh" and the system accepts this. I expect the Field Rule to force digits as the last 3 keys entered .

    Any idea what I am doing wrong ?

    Looking forward

    Dave Mac
    I don't htink you can have a mask for a field that is defined as a lookup. If you stay with the mask, the case transfromation is unnecessary.

    Your current mask is LLL\LL\000

    forward slashes, not backslashes. The forward slash has a special meaning in a mask which is why you might see

    ____L_0__

    when you begin to enter a new record.

    The mask should work if you change it to

    LLL/LL/000

  3. #3
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,444

    Default Re: Mask problem

    Dave,

    You have the '/' as '\' in your masks. But the main problem is you have a lookup on the field as well.

    The look up is trying to insert a previous value into a field that is maked as unique.

    Take out the lookup and change the mask and it will work

  4. #4
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Mask problem

    Stan?! Lance?!
    What did you guys have for breakfast this morning?

    The problem is very simple and very obvious:
    Dave is trying to do something that can not be done: create a "hybrid" field.
    He wants to mix character with numeric in the same field.
    You can't.

    What is that business about: you can't have lookup, backslshes etc..sure you can use any slashes you want & use mask with lookup ..

  5. #5
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Mask problem

    Quote Originally Posted by G Gabriel View Post
    He wants to mix character with numeric in the same field.
    You can't.
    Absolutely nothing wrong with limiting the last three characters to digits. The mask definition supports this.

    Mask Character
    Description

    L
    Any uppercase letter

    l
    Any letter

    #
    Any digit, sign or decimal

    N
    Any uppercase letter, digit, sign or decimal

    n
    Any letter, digit, sign or decimal

    A
    Any uppercase letter or digit

    a
    Any letter or digit

    0
    Any digit


    &
    Any character

    \
    Any character following \ is taken as a literal, or template character.


  6. #6
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Mask problem

    Stan:
    1-Why would you have numerics in a character field? how does that work?
    Editd out to confirm: confirmed:
    2-Tried mask with '\'..it works.
    Last edited by G Gabriel; 12-01-2006 at 10:40 AM.

  7. #7
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default Re: Mask problem

    Gabriel,

    numerals work well in character data type fields for US zip codes and phone numbers and driver's license numbers and license plates and customer id's and... and ... and ...

  8. #8
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Mask problem

    Tom:
    That's not my point.

    When you enter "numerals" in a character field, they are treated as characters not values. We all know that.

    The mask Dave designed is :
    LLL\LL\zero zero zero

    In this context, alpha is reading the mask as part character part numeric. You can't do that.

  9. #9
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Mask problem

    Quote Originally Posted by G Gabriel View Post
    Stan:
    1-Why would you have numerics in a character field? how does that work?
    Editd out to confirm: confirmed:
    2-Tried mask with '\'..it works.
    1-No one said anything about numerics but you. As Tom said, you might want certain characters in a "part number" to be alphabetic and you might want others to be digits, i.e. "ABC-123". You could disallow "ABC-ABC" with the mask LLL-000.

    2-"Tried mask with '\'..it works." -what does that mean? I didn't say it didn't work. I said it had special meaning in a mask

    \
    Any character following \ is taken as a literal, or template character.
    Which simply means that if you want a forward slash you have to use a pair of them.

  10. #10
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,444

    Default Re: Mask problem

    Gabriel,

    It was about 10 hours ago when I had breakfast so cant remember what I had, but can remember that in the UK all phone numbers begin with a zero, if you put that into a numeric field it gets dropped ie 02380 893311 would become 2380893311 and useless!

  11. #11
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: Mask problem

    Quote Originally Posted by G Gabriel View Post
    Tom:
    That's not my point.

    When you enter "numerals" in a character field, they are treated as characters not values. We all know that.

    The mask Dave designed is :
    LLL\LL\zero zero zero

    In this context, alpha is reading the mask as part character part numeric. You can't do that.
    Gabriel,
    The '000' in the mask definition are not actual numerics but rather a format code for the mask. '0' indicates to allow only a digit in that position.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  12. #12
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Mask problem

    Stan:
    No one said anything about numerics but you.
    That's what Dave has in the mask.
    OK..think about it one more time:
    If you have a numeric field, say SSN, and you want to enter a mask with "-" between the digits, in the mask definition you enter:
    999-99-9999

    On the othe hand, if the same SSN is a character field and you want to enter the same mask, you enter in the definition:
    aaa-aa-aaaa

    Now, help me out here:

    Dave has a character field and in the mask definition, he entered a mixture of characters & numerals. That's the problem.

    In the example you used, if you want something to look like: ABC-123 in a character field, you still enter it as:
    aaa-aaa not aaa-000 and when the user enter ABC123 in the field, it will be masked: ABC-123.

    Am I alone on this?

  13. #13
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Mask problem

    Stan!! Lance!! Tom!! and now Tim !!
    Did everybody go to the same McDonald's this morning? why wasn't I invited?

  14. #14
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,444

    Default Re: Mask problem

    Gabriel,

    Sorry you missed breakfast, it seems you are missing something else.

    Just try it.

    Set a new table with a character field (default 16 characters will do)

    save table.

    set a mask of LLL/LL/000

    The input on that field will then only let you enter 5 characters then upto 3 numbers simple and that is what Dave wanted in the first place. Stan put him on the right track with his first reply. I am just a slower typist and was testing to make sure I was right and replied 6 mins later. We are now several hours on and going nowhere!!!

  15. #15
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Mask problem

    Quote Originally Posted by G Gabriel View Post
    If you have a numeric field, say SSN, and you want to enter a mask with "-" between the digits, in the mask definition you enter:
    999-99-9999

    On the othe hand, if the same SSN is a character field and you want to enter the same mask, you enter in the definition:
    aaa-aa-aaaa
    As I copied and pasted in earlier, 999-99-9999 is not a valid mask because 9 is not a valid mask character. aaa-aa-aaaa is valid but would allow alphabetic characters to be entered as a ssn, not desirable.

    We are speaking of the field rules, mask tab?

  16. #16
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Mask problem

    The input on that field will then only let you enter 5 characters the upto 3 numbers simple and that is what Dave wanted in the first place
    Lance:
    You just made my point. If alpha, according to you, will only enter 5 characters, is because it does not know what to do with those digits.

    I don't think that is what Dave wants. He wants all 8 characters. What everyone seems to be missing is that, just because the last 3 characters are numerals, in the mask you define them with characters not numerics.

    I can't believe I have to keep explaining this!

  17. #17
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Mask problem

    Stan:
    You are right about 999-99-9999 as not a valid mask for a numeric field. There is no mask for a numeric field, period. But back to my point: if you have a character field that you wish to mask to ABC-123, you define the mask as:
    aaa-aaa
    NOT:
    aaa-000

  18. #18
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,444

    Default Re: Mask problem

    Gabriel,

    Please read Daves original post
    Require to create a mask to control data entry on Field BANNER_ID. I have entered a Simple Mask on BANNER_ID, Field Rules, Data Entry The BANNER_ID field (10 Chars) requires to be structured as follows :

    3 x Uppercase letters
    1 x backslash /
    2 x Uppercase letters
    1 x backslash /
    3 x digits

    I have structured the mask as LLL/LL/000.

    On a test I invoke the Banners Update Form and Push Button "New Banner" Banner_Id field gets focus. I am able to enter "abcdefgh" and the system accepts this. I expect the Field Rule to force digits as the last 3 keys entered .

    He wants the last 3 charachters to be forced as digits. It was the lookup that was preventing him from getting what he wanted. Digits can have a meaning in a character field as has been pointed out above.

    You need to read the help file on Masks before commenting any further.

  19. #19
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: Mask problem

    Quote Originally Posted by G Gabriel View Post
    In the example you used, if you want something to look like: ABC-123 in a character field, you still enter it as:
    aaa-aaa not aaa-000 and when the user enter ABC123 in the field, it will be masked: ABC-123.

    Am I alone on this?
    If you have a mask of aaa-aaa then you will be able to enter abc123 for abc-123 as you say but you would also be able enter abc-def. But if you want to want to force the first three to character and the last three positions to digits then you would use the mask of lll-000. I say again the '000' signifies 'only digits' not numerics.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  20. #20
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Mask problem

    He wants the last 3 charachters to be forced as digits
    Lance:

    The field is a character field
    Dave wants the las 3 characters as numerals
    They are still characters!
    Thus, the mask has to be LLL\\LL\\aaa not LLL\\LL\\000

    When the use enters :
    abcde123
    it will be masked to:
    ABC\DE\123
    Last edited by G Gabriel; 12-01-2006 at 11:44 AM.

  21. #21
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,785

    Default Re: Mask problem

    Where are we all going for breakfast tomorrow. i know this great little place open 24 hours. though it may take some of you 24 hours to get here. And Gabe your invited.
    Last edited by Tim Kiebert; 12-01-2006 at 11:47 AM.
    Tim Kiebert
    Eagle Creek Citrus
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  22. #22
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,444

    Default Re: Mask problem

    We all know that, Gabriel, but what he also wants is his users to be forced to only enter digits i.e. 0-9 for the last three characters of his field this is set by the 000 part of the mask!!!!!!!!!!

    If you had bothered to read the help on masks as suggested, you would realise that if you set the mask to LLL/LL/LLL he would not be able to enter the last three characters as digits as the mask would only accept uppercase letters
    Last edited by Lance Gurd; 12-01-2006 at 11:40 AM.

  23. #23
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Mask problem

    Quote Originally Posted by G Gabriel View Post
    Lance:
    You just made my point. If alpha, according to you, will only enter 5 characters, is because it does not know what to do with those digits.

    I don't think that is what Dave wants. He wants all 8 characters. What everyone seems to be missing is that, just because the last 3 characters are numerals, in the mask you define them with characters not numerics.

    I can't believe I have to keep explaining this!
    You have to keep explaining because you don't get it.

    Here's an example with three fields designed to hold data like a ssn. One field with a mask aaa-aa-aaaa, one with 000-00-0000, and one with 999-99-9999.

    The first field allows any character or digit (your way) meaning that someone could enter abcdefghi. The second allows only digits 0-9 (my way). The third (one of your suggestions) allows nothing to be entered.

  24. #24
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: Mask problem

    Lance:
    I did read Dave's question, but maybe I read it differently:
    I read the question as attempting to have the first 5 enteries as characters and the last 3 as numeric. Obviously, you can not do that. If the question would have said: I want to make sure the user enter the last three as numerals that is different from "forcing" the last 3 to be digits.

Similar Threads

  1. Mask problems
    By Martin in forum Alpha Five Version 6
    Replies: 12
    Last Post: 06-12-2006, 08:14 PM
  2. ui_get_date() has no mask
    By Bill Warner in forum Alpha Five Version 6
    Replies: 9
    Last Post: 02-14-2005, 03:14 PM
  3. Mask
    By Walter in forum Alpha Five Version 5
    Replies: 2
    Last Post: 06-25-2003, 05:32 AM
  4. Mask
    By russ Boehle in forum Alpha Five Version 5
    Replies: 0
    Last Post: 03-25-2003, 12:44 PM
  5. Simple Mask Problem
    By Richard Constantine in forum Alpha Five Version 4
    Replies: 2
    Last Post: 10-10-2001, 03:53 AM

Bookmarks

Posting Permissions

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