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 event for a form does not fire

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

    ONKEY event for a form does not fire

    I have not taken the time to upgrade to 4.5--> that being said I have a form that was designed in Verse 3 and redesigned in Verse 4. For the life of me I cannot get the onkey event to fire. It just does not happen. I have no ontimer event firing and only have the onsave event and onit event coded. They all work. What could be doing this? Could it be calc fields pertaining to this form? Any help would be GREATLY appreciated.

    #2
    RE: ONKEY event for a form does not fire

    How about posting your OnKey script?

    - Steve
    -Steve
    sigpic

    Comment


      #3
      RE: ONKEY event for a form does not fire

      Hi Steve, the onkey script is very basic something like this
      dim f as p
      f=parentform.this
      if a_user.key.event="down".and.this.active()="DATE" then
      if a_user.key.value="+" then
      f:date.value=f:date.value+1
      f:date.refresh()
      elseif a_user.key.value="-" then
      f:date.value=f:date.value-1
      f:date.refresh()
      end if

      It is not the coding that is the problem it is the fact the onkey event just does not fire! I placed the debug(1) on the top line and nothing happens.

      Comment


        #4
        RE: ONKEY event for a form does not fire

        You're missing an "end if." I put it in and it worked just fine on my test:

        dim f as p
        f=parentform.this
        if a_user.key.event="down".and.this.active()="DATE" then
        if a_user.key.value="+" then
        f:date.value=f:date.value+1
        f:date.refresh()
        elseif a_user.key.value="-" then
        f:date.value=f:date.value-1
        f:date.refresh()
        end if
        end if


        - Steve
        -Steve
        sigpic

        Comment


          #5
          RE: ONKEY event for a form does not fire

          i would rename the object date to date1, otherwise you run the risk of the system confusion
          Cole Custom Programming - Terrell, Texas
          972 524 8714
          [email protected]

          ____________________
          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

          Comment


            #6
            RE: ONKEY event for a form does not fire

            STEVE, I simply put from memory the code, the fact that teh endif was not present is not the question. What are the causes that prevent the Onkey event from accepting keys strokes, in other words what outside events may interupt the firing of onkey events? I have 35 forms and the code works on all the forms but this particular form is not. When I test for the coding with the debuger, nothing happens even the debugger is not firing. I know for instance that if you type rapidly the onkey event will not trap all the key strokes. I also know if there is an ontimer event it will interupt the onkey event scripts. Is there any other instances?

            Comment


              #7
              RE: ONKEY event for a form does not fire

              Jack,
              I have seen instances where the debug(1) did not invoke the debug window and I assumed an event wasn't happening . I'm sure you're correct about the event not firing, but if you haven't already, you might try sticking a ui_msg_box at the beginning of the script.

              Comment


                #8
                RE: ONKEY event for a form does not fire

                i believe the onkey event doesn't fire for subforms, and possibly for forms opened as dialog forms (i don't remember offhand). is your form a s ubform, by any chance?

                Comment


                  #9
                  RE: ONKEY event for a form does not fire

                  Thanks Peter, this is what I thought, although the from is a regular form it does contain a subform. The particular field is on the regular form not the subform but somehow I believe if a form contains a subform the onkey does not function. This is really unfortunate.

                  Comment


                    #10
                    RE: ONKEY event for a form does not fire

                    that seems to be the case.

                    Comment


                      #11
                      RE: ONKEY event for a form does not fire

                      I have had a problem with the ONKEY event not firing, but it is a little different than described here.

                      First, I have no problem with the ONKEY event even though the form has a subform. The problem is that it works on some computers, but not on others. More specifically, it seems to work on the computers that are running Runtime, but not on the regular A5.

                      Is this a problem with A5, but not Runtime?

                      Stephen
                      ***********
                      FYI: Here is the script that is attached to the event. As stated, it works in Runtime, but not A5:

                      IF A_user.key.value = "{F12}"
                      A_user.key.handled = .T.
                      IF A_user.key.event = "down"
                      What_Value.activate()
                      END IF
                      END IF
                      Stephen Pilon
                      Associate Librarian
                      Christendom College

                      Comment


                        #12
                        RE: ONKEY event for a form does not fire

                        Hi Steven, I have noticed a similar thing as you with outher machines, not runtime verses regular a5. I feel that the onkey does not communicate well with windows and therefore A5 has a difficult time with them. But if you use use objects the onkeys work tremendously well. Faster and smoother.

                        I have experimented with subforms and embedded subforms. Onkey will not fire while a form has a subform on it. PERIOD. The answer-->use user object.
                        end if

                        Comment


                          #13
                          RE: ONKEY event for a form does not fire

                          I don't know about subforms but onkey seems to fire OK with embedded browses or straight forms for letter keys ONLY, but does not fire on function keys. This has been a real pain and I am hoping (counting on) it is fixed on v5.
                          HOw could a user object be used to replace the onkey event for a form? Is that what you mean?

                          Thanks
                          Russ

                          Comment


                            #14
                            RE: ONKEY event for a form does not fire

                            the user object is simple a field that has unbelievable programing capablities. Simply choose a user object and then right click on the object. checkbox the transparent option and then choose the onkey event and place your codes. You will have to place an option to activate the field that lies below this field should the user press another key other than the key you are programing for. For the most part I use the '+' and'-' keys to toggle date and number fields. If the user presses any other key other than these keys the underlying field is activated.

                            Comment


                              #15
                              RE: ONKEY event for a form does not fire

                              Stephen,
                              I once ran into this problem and selwyn posted a suggestion that corrected it. He suggested combining the key value and event into one line as below.

                              if a_user.key.value ="{F12}".and a_user.key.event = "down"
                              a_user.key.handled = .T.
                              ui_msg_box("OnKey Event","F12 pressed")
                              end if

                              This syntax works consistently on both the full and runtime versions. I just tried it on a dummy form and it works correctly.

                              Jerry

                              Comment

                              Working...
                              X