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

Data entry field color change

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

    Data entry field color change

    I have been trying for hours, reading the tutorials and user guide, but can't seem to get it. Can I make the color of a field change when the new record or change record icon is clicked? If so, can you give me step by step directions? If you just give me a line of code to enter I will not know where to insert it. Thanks.

    #2
    Re: Data entry field color change

    Hi Wendy,

    Welcome to Alpha.

    Yes this can be done but there are a number of questions to be asked first.

    The field that you want to change colour, is it to just change while in enter or change mode?

    What is the field, is it just simple block of colour?

    If you want to see how to do it in your apo, can you post a sample here.

    The bottom line is, testing the Mode of the form.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      Re: Data entry field color change

      Thanks Keith. Sorry for the delay in getting back to you, I don't have a lot of time to spend on the internet some days.

      Yes, just change color while in enter or change mode.
      Is it just simple block of color? I think so.

      "If you want to see how to do it in your apo, can you post a sample here."

      I am really new to Alpha5 (used Alpha4 for years) and don't want to appear ignorant here but what is APO and how do I post a sample?

      Thanks for any help you can give me.

      Comment


        #4
        Re: Data entry field color change

        Hi Wendy,

        Excuse typo, for apo read app, short for application.

        Is the block of colour to remain changed or is it to just change while in change/enter mode?

        What do you want the colours to change from and to?
        Regards
        Keith Hubert
        Alpha Guild Member
        London.
        KHDB Management Systems
        Skype = keith.hubert


        For your day-to-day Needs, you Need an Alpha Database!

        Comment


          #5
          Re: Data entry field color change

          Hi Keith

          The database default is Modal. The user must click on "Change" or "Enter" to prevent accidental changes. When the form is first displayed the fields (under properties) are set up as Fill - Style - Translucent. When change/enter is clicked I would like the color to change to Fill - Style - Solid - Foreground Color - Green White so the user is aware they are now able to change the record. Once they click on "Save" I want it to change back to translucent.

          Comment


            #6
            Re: Data entry field color change

            Wendy,
            The attached example I believe is what you are looking for. I don't have v6 on this machine, so it is written in version 7. It should work in v6, I believe.
            Hope that helps.
            Mike W
            __________________________
            "I rebel in at least small things to express to the world that I have not completely surrendered"

            Comment


              #7
              Re: Data entry field color change

              Mike,

              Thanks for the example. I am totally new to these message boards, asking others for help, using Alpha5 and zip files. Pardon my lack of knowledge but what do I do with the file you sent me?

              Comment


                #8
                Re: Data entry field color change

                Wendy,

                Mike's attachment is a complete database - compressed.

                Click on the file to download it.
                Save it separately from your current work.
                Uncompress it.
                Open Alpha.
                Choose open database and navgate to where you uncompressed it.
                Open the database.

                You should find a form on the forms tab.
                Open the form in view mode to observe the behavior.
                Switch to design mode to see how the behavior is obtained.
                There can be only one.

                Comment


                  #9
                  Re: Data entry field color change

                  Hi Mike,

                  Talk about going beyond the call of duty.

                  Another interesting method to achieve the desired results.

                  I was going to go down the road of action script with events and setting the object fill info.

                  Might have been a little easier for Wendy to get a handle on, perhaps?
                  Regards
                  Keith Hubert
                  Alpha Guild Member
                  London.
                  KHDB Management Systems
                  Skype = keith.hubert


                  For your day-to-day Needs, you Need an Alpha Database!

                  Comment


                    #10
                    Re: Data entry field color change

                    Keith, Mike and Stan,

                    Thanks so much for your help. Although I was not able to "get a handle on it" I am very appreciative for your time and effort.

                    I am not a programmer and I was able to create all the applications for my small business years ago in Alpha4. But it is now time to move on to Alpha5 and must focus on recreating the applications. I just do not have the time to spend on the "small stuff" and must get a working application completed first. Maybe I can try again at a later date.

                    Thanks again.
                    Wendy

                    Comment


                      #11
                      Re: Data entry field color change

                      Keith,
                      I tried to do this with action scripting and not knowing the field names, I went for the generic approach.

                      Wendy,
                      It is quite straight forward really. Replace your table name for what's in red.
                      1). In the code tab of the control panel, choose the NEW button, the Function menu item, and for the function name make it field_available . Then add the following between the FUNCTION -END FUNCTION lines and save the function:

                      Code:
                      ' this function is called from the "change" and add buttons on the ____ Form
                      
                      ' specify the table name
                      	dim vtable_name as C
                      	vtable_name="[COLOR="Red"]YOUR_TABLE_NAME[/COLOR]"
                      
                      ' get the list the fields
                      	dim vLfields as c
                      	vLfields = table.external_field_name_get(vtable_name,"N")
                      	
                      ' loop through the fields and change color
                      	dim vFW as C
                      	for each foo in vLfields
                      		vFW = alltrim(foo.value)
                      		evaluate_template("parentform:"+vFW+".field.readonly = .F.")
                      		evaluate_template("parentform:"+vFW+".fill.style = \"solid\"")
                      		evaluate_template("parentform:"+vFW+".font.color = \"White\"")
                      		evaluate_template("parentform:"+vFW+".fill.forecolor = \"Dark Green\"")
                      	next
                      To the form button to add a new record, place the lines that are in the example OnPush event for the Add button and Change button, to your forms add and change buttons OnPush event, changing the field name (red) to your field name in the last lines: parentform:your_field_name.activate()

                      2). In the code tab of the control panel, choose the NEW button, the Function menu item, and for the function name make it field_unavailable . Then add the following between the FUNCTION -END FUNCTION lines and save the function:
                      Code:
                      ' this function is called from the "save" button on the Main Form and in the form Ininit event
                      
                      ' specify the table name
                      	dim vtable_name as C
                      	vtable_name="[COLOR="Red"]YOUR_TABLE_NAME[/COLOR]"
                      
                      ' get the list the fields
                      	dim vLfields as c
                      	vLfields = table.external_field_name_get(vtable_name,"N")
                      	
                      ' loop through the fields and change color
                      	dim vFW as C
                      	for each foo in vLfields
                      		vFW = alltrim(foo.value)
                      		evaluate_template("parentform:"+vFW+".field.readonly = .t.")
                      		evaluate_template("parentform:"+vFW+".font.color = \"light tan\"")
                      		evaluate_template("topparent:"+vFW+".fill.style = \"transparent\"")
                      	next
                      To the form button to save the record, place the lines that are in the example's OnPush event for the Save button. Also call the function in the form Init event by adding the line: field_unavailable().

                      That should do it. Holler back with any more questions.
                      Mike W
                      __________________________
                      "I rebel in at least small things to express to the world that I have not completely surrendered"

                      Comment


                        #12
                        Re: Data entry field color change

                        Thanks Mike.

                        I guess part of my problem was I was using the icons on the tool bar, I did not have add, change, and save buttons on the form. I can add them.

                        Also, can I specify field names? Not all of the fields on the form are allowed to be updated.

                        Comment


                          #13
                          Re: Data entry field color change

                          Hi Wendy,

                          "can I specify field names?" Yes you can, that is what Mike would have also suggested if he had known the field names.

                          Please see screen shot of what to select from Action Scripting.

                          After clicking OK you will have another dialog where you select the fields you want to fill and you can select the colour for each field.

                          Have a play with that first, then you will be able to set the condition as to when the fields get filled.

                          Let Action Scripting do the work for you.
                          Regards
                          Keith Hubert
                          Alpha Guild Member
                          London.
                          KHDB Management Systems
                          Skype = keith.hubert


                          For your day-to-day Needs, you Need an Alpha Database!

                          Comment


                            #14
                            Re: Data entry field color change

                            Keith is right that I would have lead you through the Action scripting if I had known the field names of the fields that you wished the Object Properties adjusted conditionally. I recommend you try it with the action scripting for learning purposes. If not, you can designate the fields in the code I provided by generating your own list. In the section that captures the field names using the table.external_field_names_get(), you can replace that with your own list as follows (replace what is in red with your field names, and you need to make the list in both the available() and unavailable() functions).

                            Code:
                            [COLOR="Blue"]' get the list the fields[/COLOR]
                            dim vLfields as c
                            vLfields = <<%a%
                            [COLOR="Red"]your_field_#1
                            your_field_#2
                            your_field_#3[/COLOR]
                            and so on...
                            %a%
                            Mike W
                            __________________________
                            "I rebel in at least small things to express to the world that I have not completely surrendered"

                            Comment

                            Working...
                            X