Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Masked fields for display only

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Masked fields for display only

    Help!

    I've been around and around with the documentation and field rules screen trying to figure out how to insert dashes into the DISPLAY of a field, not into the actual field. Example:

    Field is 11 character field:

    12345123412

    I want to DISPLAY it on the screen as:

    12345-1234-12

    I do NOT want to make it a 13 char field as I much match to another DBF carrying it as 11 char field.

    Every time I've tried this, the dashes have been kept in the field and the last two digits of the part # have been truncated! (I've been checking "Do not store literals as part of field box" and then unchecking it. Can't find a comination that works.)

    Any help is appreciated....

    Chris

    #2
    RE: Masked fields for display only

    Chris,

    You could define a Global Calculated Field, which you could use in both your forms and reports.

    It would be something like Left(Yourfield,5)+"-"+Substr(Yourfield,6,4)+"-"+Right(Yourfield,2)

    Comment


      #3
      RE: Masked fields for display only

      Thanks, but is there anything simpler? In Access I could just use a mask like:

      00000-0000-00

      and it would work.

      Chris

      Comment


        #4
        RE: Masked fields for display only

        I quess I did miss the obvious.

        You should be able to do what you want using field rules.

        Did you read User Guide, page 112, under Masks, "Specifying That Mask Literal Characters Are Not Stored".

        You should be able to specify a mask without actually storing the extra characters.

        Comment


          #5
          RE: Masked fields for display only

          Chris,

          Just tested this mask in field rules and it works fine.

          Though you don't have to change the structure of your table to accomodate the extra characters, if you display your field on a form or report, you will need to adjust the size of the form/report field properties so you can see the entire field.

          Hope that makes sense.

          Comment


            #6
            RE: Masked fields for display only

            Thanks for your help, but I must be brain dead or something. I have tried setting up field rules several times, and and all resulted in the last two characters of my field being truncated. I am using:

            Simple Mask: 00000-0000-00 "do not store mask literals in field" IS checked.

            What am I doing wrong????

            Chris

            Comment


              #7
              RE: Masked fields for display only

              Chris, that's not a fair question.

              Try telling us exactly what you are doing, and we can tell you what looks wrong to us. I'll try to whip up a simple example for you this evening. Perhaps by comparing yours to mine, you will be able to see the differences.

              -- tom

              Comment


                #8
                RE: Masked fields for display only

                I have a little test database with 5 fields, each 11 char long and filled with the string "12345123412".

                I went to field rules and defined as stated above:

                Simple Mask
                Mask reads: 00000-0000-00
                I DID check the box "do not store mask literals in field"

                When I save the field rule and look back at the data (and yes, I did widen the field on the screen to make sure I was seeing the whole thing), this is what I see:

                12345-1234-

                It looks to me like it DID store the literals and truncated the right two characters.

                Is there another way to look at the data? I just widened the field to provide plenty of space and the last two char are not visible.

                I tried opening just the little test DBF file with A5 and it said "unexpected file format"????
                Chris

                Comment


                  #9
                  RE: Masked fields for display only

                  Chris, the field object used to display your field in the form must be increased. It defaults to the width in your table (11). When the mask inserts two new characters (the hyphens) the new string (which is now 13 chars long) won't fit. Open form in design mode, and adjust the display width property of the field object. You'll find it on the format tab page I believe.

                  I verified that the field rule is working as expected just now. Here's a summary of my own findings. Perhaps you'll find it useful.

                  Code:
                  Used this mask for Character type field:
                  
                  00000-0000-00
                  Checked box so that mask literals would NOT be stored in field
                  
                  Got these results when entering field value:
                  12345123412
                  
                  Structure	Value stored   			Value displayed
                  Field Width	in field			on form or browse
                  11		"12345123412"			12345-1234-12 (Note1)
                  
                  
                  13		"12345123412  "	(Note2)		12345-1234-12
                  
                  
                  Once this field rule is defined, it's difficult to verify what
                  value is stored in the field, because the mask is used to
                  insert hyphens each time the field is displayed on a form
                  or in a browse.  Actual values stored in the field were 
                  determined using third party tools (Excel and WordPerfect).
                  
                  Note1:  To display the complete value, the display field or column
                  must be increased to 13, even though the field width in the table
                  is only 11.
                  
                  Note2:  Left justified, with two blank spaces trailing the 11
                  character string of numbers.
                  --tom

                  Comment


                    #10
                    RE: Masked fields for display only

                    Tom,
                    I am unable to duplicate your results here. In fact, I get the same thing as Chris. If I create an 11 character field and define a mask as 0000-00-00000 and then set the field width on the form to 13, I can get only 1234-56-789 on the form.

                    Comment


                      #11
                      RE: Masked fields for display only

                      Maybe what I'm not "getting" is what you termed "Structure Field Width".

                      In browse mode I just opened the field to a wider column by dragging the column wider.

                      In Form mode I widened the field contents box to way wider than would be necessary to see all characters.

                      In both instances, date looked truncated.

                      Is there some other place that I need to set the "Structure Field Width" to 13?

                      I did open up the DBF file in Excel and still see the full 11 characters as you did. The problem must be in how the display is set, yet dragging the field to a wider width is my normal way in Access of seeing the wider contents. Is there another way to do this in A5?

                      Chris

                      Comment


                        #12
                        RE: Masked fields for display only

                        Chris and Ohlen,

                        The display in the browse layout shows only the first 11 chars of the string. I cannot get it to show the full 13 (11 in table structure, plus 2 more added in field rules.)

                        However, if you guys will play with the default form for the table (instead of the browse) you can get the desired result if you do two things:

                        a) stretch the field object wide enough to show all 13 chars; and

                        b) as I indicated before, visit the field object in design mode and set its display width to 13.

                        Both are required. This is how it works in Vers 4 also. Simply grabbing an edge of the field object on the form and dragging it wider is not enough. The display width (format) of the field object must be adjusted, too.

                        -- tom cone

                        Comment


                          #13
                          RE: Masked fields for display only

                          Chris, I don't recall a lot of message traffic on this mask issue. My assumption has always been that just about everyone wants the mask characters stored in the field, they just don't want the operator to have to key them in. If my assumption is right, then your desire to strip the mask characters out for storage purposes, and then put them back in for display purposes, is in the distinct minority. I've always felt that your approach was more trouble than it's worth. Even if I have share the data with other programs it's easier to write a script which removes the hyphens than to never know whether or not what you see on the screen is actually what's in the table.

                          -- tom

                          Comment


                            #14
                            RE: Masked fields for display only

                            Chris & Ohlen,

                            I owe you both an apology.

                            Turns out my form works well only because I entered the 11 digit number while the mask was turned off. when I turned it back on the form behaves correctly, as I described. Otherwise, the form won't let you enter more than 11 digits, including the mask chars, if the table field width is only 11... even if the display width of the field object on the form is set to 13.

                            Hadn't run into this before the reasons outlined above. Most store the literals in the field.

                            simple solution here is to change table structure to increase the stored field width to 13. Costs you two blank spaces at the end of each 11 digit field, but these can always be trimmed off.

                            My own strong preference would be to store the mask literals with the data.

                            If time permits I'll see if this is behaving differently in vers 5 than in vers 4.

                            -- tom

                            Comment


                              #15
                              RE: Masked fields for display only

                              Chris, Ohlen,

                              this same behavior seems to have been present in vers 4, also. Check this link in the vers 4 forum:

                              http://msgboard.alphasoftware.com/alphaphorum/read.php3?sortby=lastreply&direction=desc&num=4&id=4053&thread=4053

                              -- tom

                              Comment

                              Working...
                              X