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

OnKey

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

    OnKey

    Morning

    I have 1 form open, it's in View mode, and it has focus, but I can't get any reaction from the form's OnKey event.

    I tried my own scripts and nothing at all happens.
    I copied and pasted a code from a Cal Locklin message board post:

    IF a_user.key.value = "{ESC}"
    IF parentform.mode_get() = "View"
    a_user.key.handled = .T.
    IF a_user.key.event = "down"
    parentform.close()
    END IF
    END IF
    END IF

    Nothing

    I added 'then' after each IF statement

    Nothing

    I don't see anything in the form's properties that would impede this event. I have done OnKey stuff in V6, but I can't seem to do it in V5.
    Any idea what I'm doing wrong?

    Thanks
    Duane

    #2
    RE: OnKey

    Duane,

    Based on what you have said in your message, pressing the 'esc' key should close the form. I use the same exact code on some forms and they work fine in both V5 and V6. Maybe you can strip down the db and attach the table/form where you have tried this in V5 with no results. Since I am unable to duplicate your reported problem, that leads me to think that it is something specific to your form.

    Cheryl
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

    Comment


      #3
      RE: OnKey

      I just tested the code in V5 and it worked fine - when the form is in view mode. Otherwise it does nothing. I would suspect your form is not in view mode.
      There can be only one.

      Comment


        #4
        RE: OnKey

        Thanks to both for checking this out

        I know it's weird and has to be something I have in the form. It's a farily big form based on a set so I'll have to try to take the time tonight to strip it down for transportation.
        I 'm not actually trying to use the form close on the 'ESC' key, I'm trying to get a calc or var field to show me if the form has the allow_changes On or OFF for editing. Doing a trap on the F3 key push and refreshing the form to display the calc field wasn't working. So I tried Cal's script for closing; it didn't work either. So no OnKey event works at all for this form.
        I've compacted it right into the desk and the form indicates it is in view mode, so I'm still confused. Unless the form is corrupted? I'll try that approach and see what's up

        Thanks
        Duane

        Comment


          #5
          RE: OnKey

          Does your Data Entry Style impact this?

          -- tom

          Comment


            #6
            RE: OnKey

            Duane,

            Feel free to zip up your db and email it to me if this will save you time from stripping it down. Be sure to give me steps to duplicate your problem so that I do not waste time looking around to find the issues.

            Good luck
            Cheryl
            Cheryl
            #1 Designs By Pagecrazy
            http://pagecrazy.com/

            Comment


              #7
              RE: OnKey

              Thanks Cheryl, just need to find some time yet to copy it and dump a bunch of records

              Tom, it's in modeless data entry. I haven't tried to change it. In fact I can have a dropdown previous value lookup field selected ready to change, form still in view mode, and still the OnKey doesn't do anything.

              Thanks
              Duane

              Comment


                #8
                RE: OnKey

                Finally

                Here is the zipped app. The photos folder is just for the display on the photo tab.
                It is an inhouse tool we use and is an ongoing work project.

                The form in question is the main_tab, the OnFetch sets the form to allow_changes(.f.) so we keep screwups down.

                What I am trying to accomplish with these posts is to refresh the form on pushing the F3 key, so the calc field 'editmode' shows "Yes" or "No" depending on the edit state of the form. The calc field changes accordingly when you push F5, but I want it to do that automatically.
                All the ui_msg_boxes in the form's OnKey code is just so I can see where the code gets to. But it doesn't even start.

                It has to be something simple that I have wrong, but ....

                Thanks
                Duane

                Comment


                  #9
                  RE: OnKey

                  Duane,

                  I have just started testing, but it is definitely tied to the specific form itself because I was successfully able to get the ESC key to close the form using the customer form. I will let you know what else I find.

                  Unless of course, somebody is much faster than I am :)

                  Good luck
                  Cheryl
                  Cheryl
                  #1 Designs By Pagecrazy
                  http://pagecrazy.com/

                  Comment


                    #10
                    RE: OnKey

                    Duane,

                    Hopefully somebody else can also take a look at this. The form is definitely complicated and so far I cannot see real quick what is causing the conflict with the OnKey event.

                    I can tell you this .... something that is really odd .... when I open the form in view mode, I get an error .... not an executable file. This is probably the cause of the OnKey event not working, but I am still trying to figure out what is causing that error.

                    Cheryl
                    Cheryl
                    #1 Designs By Pagecrazy
                    http://pagecrazy.com/

                    Comment


                      #11
                      RE: OnKey

                      Thanks for looking Cheryl

                      I don't recall having that error recenly with this particular app
                      Maybe cause you are missing the Photos folder for the Photos tab. I'll try to attach that to this post. It goes into the same folder you have the adb in.

                      Thanks
                      Duane

                      Comment


                        #12
                        RE: OnKey

                        Duane,

                        I did not take your attachment. However, once I deleted the sub form on the photos tab, the ESC OnKey event works fine. I did not test your OnKey, but verified that without your subform the OnKey functions properly.

                        Now you get to test your other OnKey events as well as determine what the problem is with the sub form.

                        Good luck
                        Cheryl
                        Cheryl
                        #1 Designs By Pagecrazy
                        http://pagecrazy.com/

                        Comment


                          #13
                          RE: OnKey

                          Duane,

                          On another note, the 'view' calculated field you have in the upper right hand corner is an invalid expression. You may want to take a look at that as well.

                          Good luck
                          Cheryl
                          Cheryl
                          #1 Designs By Pagecrazy
                          http://pagecrazy.com/

                          Comment


                            #14
                            RE: OnKey

                            Thanks Cheryl

                            Yeah, I saw that invalid message but it works. I just thought it was a bad message.

                            Well you're right. It has to do with the subform. I took it out and the OnKey works. I put in another subform but used a default form based on another table, the OnKey did not work.

                            I did get over what started all this; used F11 instead of the pgm F3, to do the allow/disallow changes and to refresh the form calc fields.

                            Now, just to figure out why the subform gives grief. May have to have the photos display on a separate opening form (should have done a lot of that in the first place)

                            Thanks again
                            Duane

                            Comment


                              #15
                              RE: OnKey

                              Duane,

                              It is not a bad message, it may work, but that would be a bug. I would definitely look at changing your calc field so that it is a valid expression.

                              Instead of using a sub form, try to put the data you want on the tab and see if that resolves the sub form issue.

                              Good luck
                              Cheryl
                              Cheryl
                              #1 Designs By Pagecrazy
                              http://pagecrazy.com/

                              Comment

                              Working...
                              X