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

ON_KEY on a Form containing a Sub Form

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

    ON_KEY on a Form containing a Sub Form

    If I�m correct, when using the ON_KEY events on a Form that contains a Sub form, the �topparent. Or parentform.� Can not be used, for example:

    if a_user.key.value = "{F2}".and. a_user.key.event = "down"
    topparent.new_record()
    end if

    OR

    if a_user.key.value = "{F10}".and. a_user.key.event = "down"
    parentform.commit()
    end if

    Also the �sys_send_keys� Can not be used, for example:

    (used for Lookup)
    if a_user.key.value = "{F5}" .and. a_user.key.event = "down"
    sys_send_keys("{Alt-Down}")
    end if

    OR

    (used to drop down the Find in a custum menu)
    if a_user.key.value = "{F7}" .and. a_user.key.event = "down"
    sys_send_keys("{Alt-F}")
    end if

    The above KEYS work on a Form not containing a Sub Form, I guess this is an �Addresses� problem, dose anyone have a solution to this without using �Absolute addressing�?

    Thank You
    Dan
    Daniel Weiss
    EZ Link Software

    #2
    RE: ON_KEY on a Form containing a Sub Form

    I was incorrect about the Addresses problem, even �Absolute addressing� wont work, actually it seems like the ON_KEY event wont work at all on a From with a Sub Form on it.
    This cases me a problem because I showed my client an App that I designed for an other customer with all the following ON_KEY events, which got him vary excited by the fact that they wont have to use the mouse so much. His Form has to have a Sub Form on it I can�t do away without it.
    Any help would be greatly appreciated.

    My ON_KEY events

    if left(a_user.key.value,1)"{"
    cancel()
    end
    end if
    dim mode as c
    mode = parentform.mode_get()
    'enter
    if a_user.key.value = "{F2}".and. a_user.key.event = "down"
    parentform.new_record()
    end if
    'lookup
    if a_user.key.value = "{F5}" .and. a_user.key.event = "down"
    sys_send_keys("{Alt-Down}")
    end if
    'find
    if a_user.key.value = "{F7}" .and. a_user.key.event = "down"
    sys_send_keys("{Alt-F}")
    end if
    'save
    if a_user.key.value = "{F10}".and. a_user.key.event = "down"
    parentform.commit()
    end if
    'cancel
    if a_user.key.value = "{F8}".and. a_user.key.event = "down"
    code=UI_YES_NO+UI_QUESTION_SYMBOL+UI_FIRST_BUTTON_DEFAULT
    note = "ARE YOU SURE YOU WANT TO LOSE YOUR CHANGES?"
    if mode = "ENTER" .or. mode = "CHANGE"
    response = ui_msg_box("EZ Link",note, code)
    if response = UI_YES_SELECTED
    parentform.cancel()
    elseif response = UI_NO_SELECTED
    cancel()
    end if
    end if
    end if
    'close
    if a_user.key.value = "{F9}" .and. a_user.key.event = "down"
    code=UI_YES_NO_CANCEL+UI_QUESTION_SYMBOL+UI_FIRST_BUTTON_DEFAULT
    note = "SAVE CHANGES BEFORE LEAVING?"
    if mode = "ENTER" .or. mode = "CHANGE"
    response = ui_msg_box("EZ Link",note, code)
    if response = UI_YES_SELECTED
    parentform.commit()
    parentform.close()
    elseif response = UI_NO_SELECTED
    parentform.cancel()
    parentform.close()
    else
    cancel()
    end if
    else
    parentform.close()
    end if
    end if
    'Esc key
    if a_user.key.value = "{ESC}".and. a_user.key.event = "down"
    code=UI_YES_NO+UI_QUESTION_SYMBOL+UI_FIRST_BUTTON_DEFAULT
    note = "ARE YOU SURE YOU WANT TO LOSE YOUR CHANGES?"
    if mode = "ENTER" .or. mode = "CHANGE"
    response = ui_msg_box("EZ Link",note, code)

    if response = UI_YES_SELECTED
    topparent.cancel()
    elseif response = UI_NO_SELECTED
    parentform.commit()
    end if
    end if
    end if
    'print Key
    print:
    if a_user.key.value = "{F12}".and. a_user.key.event = "down"
    PARENTFORM.commit()
    Invoice_No.Activate()
    tabno = Tabbed1.Tab_Get()
    if tabno = 2
    Tabbed1.Tab_Set(1)
    end if


    current_record = alltrim(str(recno(),10,0))
    :Report.print("INVOICE","BETWEEN(RECNO(),"+ current_record+ "," + current_record+")")
    parentform.new_record()
    end if
    'Change tabs
    if a_user.key.value = "{F3}".and. a_user.key.event = "down"
    tabno = Tabbed1.Tab_Get()
    if tabno = 1
    Tabbed1.Tab_Set(2)
    Browse1:Item_Code.Activate()
    elseif tabno = 2
    Tabbed1.Tab_Set(1)
    end if
    end if
    end

    Thanks
    Dan
    Daniel Weiss
    EZ Link Software

    Comment


      #3
      RE: ON_KEY on a Form containing a Sub Form

      the onkey event works for the parent form. the onkey event does not work for the subform. where have you placed the onkey script?

      Comment


        #4
        RE: ON_KEY on a Form containing a Sub Form

        Thanks Dr. Wayne
        I placed the onkey script on the onkey events of the parent form
        Dan Weiss
        Daniel Weiss
        EZ Link Software

        Comment


          #5
          RE: ON_KEY on a Form containing a Sub Form

          Dr. Wayne
          I double-checked it again; if I remove the Sub Form from the Parent form all the ONKEY,s from my above script work fine. but with the sub form on it none work at all. I just need them to work for the Parent form
          Thank You
          Dan Weiss
          Daniel Weiss
          EZ Link Software

          Comment


            #6
            RE: ON_KEY on a Form containing a Sub Form

            Dr. Wayne
            Please try a test to see if the ONKEY event could work on a form that has a sub form on it.
            I tried to add a sub form to the invoice entry of the invoice sample that is shipped with alpha5, and I put this script on the ONKEY event. It did not work at all, but without the sub form it works fine.

            If a_user.key.value = "{F2}".and. a_user.key.event = "down"
            topparent.new_record()
            end if

            Your help would be greatly appreciated, because this is causes me a problem with one of big clients.

            Thank you
            Dan Weiss
            Daniel Weiss
            EZ Link Software

            Comment


              #7
              RE: ON_KEY on a Form containing a Sub Form

              Daniel, just tried this
              if a_user.key.value = "{F2}".and. a_user.key.event = "down"
              parentform.new_record()
              end if

              and it works..... be sure you do not have an ontimer event firing. The ontimer events seem to cancel your keystrokes. Jack

              Comment


                #8
                RE: ON_KEY on a Form containing a Sub Form

                Dan,
                I believe you are right - the OnKey events don't fire for forms iwith subforms. I did a search on the message board - this issue came up last year - for some reason, I thought it was resolved, but apparently it never was.

                Comment


                  #9
                  RE: ON_KEY on a Form containing a Sub Form

                  Dr Wayne

                  I think I found a solution for the ONKEY event on forms with a sub form on it, if you also put the same ONKEY event script on sub forms onkey event, most of the events work fine for both forms. In fact all of the following events fire correctly, the only one that causes a confusion when the cursor is on the sub form, is the �.new_record()� event the parent form goes into entry mode while the sub form stays in entry or change mode. The solution for this problem is to Activate first the field on the parent form before putting it into entry mode. Then it works fine.
                  The following is my script for the ONKEY event, which I put on both forms (parent & sub) they all seem to work fine.

                  if left(a_user.key.value,1)"{"
                  cancel()
                  end
                  end if
                  dim mode as c
                  mode = parentform.mode_get()
                  'enter
                  if a_user.key.value = "{F2}".and. a_user.key.event = "down"
                  Entry_Type.Activate()
                  Topparent.new_record()
                  end if
                  'lookup
                  if a_user.key.value = "{F5}" .and. a_user.key.event = "down"
                  sys_send_keys("{Alt-Down}")
                  end if
                  'find
                  if a_user.key.value = "{F7}" .and. a_user.key.event = "down"
                  sys_send_keys("{Alt-F}")
                  end if
                  'save
                  if a_user.key.value = "{F10}".and. a_user.key.event = "down"
                  parentform.commit()
                  end if
                  'cancel
                  if a_user.key.value = "{F8}".and. a_user.key.event = "down"
                  code=UI_YES_NO+UI_QUESTION_SYMBOL+UI_FIRST_BUTTON_DEFAULT
                  note = "ARE YOU SURE YOU WANT TO LOSE YOUR CHANGES?"
                  if mode = "ENTER" .or. mode = "CHANGE"
                  response = ui_msg_box("EZ Link",note, code)
                  if response = UI_YES_SELECTED
                  parentform.cancel()
                  elseif response = UI_NO_SELECTED
                  cancel()
                  end if
                  end if
                  end if
                  'close
                  if a_user.key.value = "{F9}" .and. a_user.key.event = "down"
                  code=UI_YES_NO_CANCEL+UI_QUESTION_SYMBOL+UI_FIRST_BUTTON_DEFAULT
                  note = "SAVE CHANGES BEFORE LEAVING?"
                  if mode = "ENTER" .or. mode = "CHANGE"
                  response = ui_msg_box("EZ Link",note, code)
                  if response = UI_YES_SELECTED
                  parentform.commit()
                  parentform.close()
                  elseif response = UI_NO_SELECTED
                  parentform.cancel()
                  parentform.close()
                  else
                  cancel()
                  end if
                  else
                  parentform.close()
                  end if
                  end if
                  'Esc key
                  if a_user.key.value = "{ESC}".and. a_user.key.event = "down"
                  code=UI_YES_NO+UI_QUESTION_SYMBOL+UI_FIRST_BUTTON_DEFAULT
                  note = "ARE YOU SURE YOU WANT TO LOSE YOUR CHANGES?"
                  if mode = "ENTER" .or. mode = "CHANGE"
                  response = ui_msg_box("EZ Link",note, code)
                  if response = UI_YES_SELECTED
                  topparent.cancel()
                  elseif response = UI_NO_SELECTED
                  parentform.commit()
                  end if
                  end if
                  end if
                  'print Key
                  print:
                  if a_user.key.value = "{F12}".and. a_user.key.event = "down"
                  sys_send_keys("{Alt-P}")
                  end if
                  'Change tabs
                  if a_user.key.value = "{F3}".and. a_user.key.event = "down"
                  tabno = Tabbed1.Tab_Get()
                  if tabno = 1
                  Tabbed1.Tab_Set(2)
                  Browse1:Item_Code.Activate()
                  elseif tabno = 2
                  Tabbed1.Tab_Set(1)
                  end if
                  end if
                  end

                  Good Luck
                  Dan Weiss
                  Daniel Weiss
                  EZ Link Software

                  Comment

                  Working...
                  X