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

Xbasic to Activate Drop Down

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

    Xbasic to Activate Drop Down

    OK, After spending an hour each night for the last 3 nights, it's time to shed my pride.

    I know the code to cause a drop down field to drop down every time but I need code to cause it to drop down only if it's a new record or if the field is empty. The field rules drop down conditionally but can't (for the life of me) come up with the correct code. I've tried several version but no go.

    I've tried the isblank("fieldname"), etc. What code will cause a drop down field to automatically drop down if the field is empty, even if a record exists and the field is empty.

    Thanks,

    kenn
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

    #2
    RE: Xbasic to Activate Drop Down

    Hi Ken,

    I have not tried this but how about a logical field that is hidden and has a default of F. This gets set to T when the record is saved. Now you have got a field to test for a condional lookup. Let us know if this works.

    Keith Hubert
    London.
    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: Xbasic to Activate Drop Down

      Hi Keith,

      I don't understand. I want the drop down box to drop down under 2 conditions:

      1) upon creating a new record and focus comes to the drop down field and;

      2) when editing an existing record, the drop down field is empty, focus comes to the field and the drop down, drops down.

      Thanks,

      kenn
      TYVM :) kenn

      Knowing what you can achieve will not become reality until you imagine and explore.

      Comment


        #4
        RE: Xbasic to Activate Drop Down

        Hi Ken,

        I dont understand either. Are you saying that an existing record would have a blank drop down lookup field, if that is the case then that field will always be blank, or am I missing something? (Probably am).

        Keith Hubert
        London.
        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: Xbasic to Activate Drop Down

          Keith,

          Let me try again, my explanation is not the best.

          The field is set up in the field rules as a look up to a table. The Display as drop-down list box is checked. Auto Popup is set to Popup on Entrance. If it's a new record, when focus comes to the field the list box automatically drops down.

          It can be set to Popup conditionally on entrance. I want to set the condition to popup upon entrance IF there is no value in the field, either new or existing record. Popup on Entrance will only allow it to dropdown if it's a new record. Once the record is saved, if there is no value in the field, the user must click the down arrow. That's the way it should be if there's a value, but when there's no value or the field is empty, I want it to drop down automatically so the user can select a value.

          I have the code to popup all the time but that's a nuisance for the user to reselect the value when simply tabbing to another field and ya have to pass thru this field first.

          Thanks,

          kenn
          TYVM :) kenn

          Knowing what you can achieve will not become reality until you imagine and explore.

          Comment


            #6
            RE: Xbasic to Activate Drop Down

            Ken

            I don't think you can get what you want directly, in xbasic or otherwise. In A5V1, a lookup set to popup under various conditions would work in both enter and change mode. In later versions, popup only works in enter mode.

            It might be nice if drop downs could be set to optionally open in change mode. The problem is when is the form in change mode? When a form opens it is in view mode, even if editing is allowed. It isn't until a change is begun that the mode switches to "Change". If the first field the user tries to change is the one with the lookup, it is in view mode when the field gets focus.

            One possibiltiy is to use the OnArrive event to test for some condition. If the condition is met, you could open your own "lookup" window. Frankly, if the user can't figure out to click the arrow, they are pretty dense and I would worry about them being able to enter any data correctly.

            Jerry

            Comment


              #7
              RE: Xbasic to Activate Drop Down

              Ken

              I missed one part of your message. How to conditionally open the lookup in enter mode. Set the lookup to open conditionally with an expression

              isblank("fieldname")

              Isblank() requires the field name to be in quotes. If the field has a value, the lookup won't open automatically. If it is blank, the lookup will pop up. This will only work in enter mode.

              Jerry

              Comment


                #8
                RE: Xbasic to Activate Drop Down

                Jerry,

                I tend to agree with your last comment. Ken could program a hotkey using the OnKey event if the user doesn't want to use the mouse. I suppose the onKey event would simply shift focus to the field and use sys_send_keys() to pass an Alt-Down key sequence. Right ?

                -- tom

                Comment


                  #9
                  RE: Xbasic to Activate Drop Down

                  Tom

                  I always forget about sys_send_keys() since I use it rarely. How about this on the OnArrive event for a field object on a form that has a lookup?

                  if this.value = "" .and. topparent.mode_get() = "CHANGE"
                  sys_send_keys("{alt-down}")
                  end if

                  this will work if the form is already in change mode. But this will put it into change mose if editing is allowed

                  if this.value = "" .and. allow_editing() sys_send_keys("{alt-down}")
                  end if

                  Gee, I guess it can be done with a little work and more than one head working on it.

                  Jerry

                  Comment


                    #10
                    RE: Xbasic to Activate Drop Down

                    Hi Jerry,

                    Yes, I did try isblank("fieldname") but it was if it wasn't there I also tried isblank(sys_send_keys("{%down}"))but that didn't work either.

                    Although it would be nice, I'm not inclined to get real fancy with this as it's not imperative the field drops the list when in edit mode.

                    The field rules work when enteriing a new record, so probably just as well to leave it at that.

                    kenn
                    TYVM :) kenn

                    Knowing what you can achieve will not become reality until you imagine and explore.

                    Comment


                      #11
                      RE: Xbasic to Activate Drop Down

                      Ken

                      See my response above to Tom about sys_send_keys() on a form event. It actually works pretty well.

                      Jerry

                      Comment


                        #12
                        RE: Xbasic to Activate Drop Down

                        Hi Ken,

                        At the risk of stating the obvious wouldn't popup on mismatch give you most of what you want so long as the lookup source doesn't contain a blank record.

                        I realize this will not popup on entrance to the field but it will popup the list if the user clicks outside the field or presses enter. The only way a user could avoid the popup would be to type in a correct entry.

                        Bill
                        Bill Hanigsberg

                        Comment


                          #13
                          RE: Xbasic to Activate Drop Down

                          Hi Bill,

                          I don't know. Popup on mismatch is not an option anymore, at least no on my version. I remember it being there but it's just not there anymore unless it's somewhere else and we're not looking at the same field rule.

                          Thanks for your reply.

                          kenn
                          TYVM :) kenn

                          Knowing what you can achieve will not become reality until you imagine and explore.

                          Comment


                            #14
                            RE: Xbasic to Activate Drop Down

                            Hi Jerry,

                            Tried both suggestions. I had to change the first one to:

                            if this.value = ""
                            sys_send_keys("{alt-down}")
                            end if

                            I got an error message with the 2nd example, extra character at the end of the expression so I changed it to:

                            if this.value = "" .and. allow_editing(sys_send_keys("{alt-down}"))
                            end if

                            I had to put the sys_send within the allow_editing ().It works, too good, it drops down even when there is a value in the field.

                            Thank you for figuering this out. Your time is very much appreciated.

                            kenn
                            TYVM :) kenn

                            Knowing what you can achieve will not become reality until you imagine and explore.

                            Comment


                              #15
                              RE: Xbasic to Activate Drop Down

                              Hi Ken,

                              You gave me a start as I spent yesterday revising field rules in a A5Ver.4 application. But I just checked in V5 and the option is still there on the lookup tab in field rules under "auto popup".
                              -popup on mismatch
                              -popup conditionally
                              etc.

                              So the option exists. Whether it does what you need is another matter.

                              Bill
                              Bill Hanigsberg

                              Comment

                              Working...
                              X