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

Combo Box troubles

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

    Combo Box troubles

    Very new to A5V9 - working my way through and enjoying it so far.

    I've placed a combo box on a form for the purpose of displaying the fields in a table and, when a record is selected from the combo box, the record in the form should be found and displayed.

    The combo box is defined as a Variable (clmlookup) defined through the combo box dialog. I've selected an Action script for the OnChange event... the xbasic code turns out to be this:

    'Goto record with specified key value in current form.
    DELETE var_key_target
    var_key_target = ClmLookup
    topparent.find(var_key_target)


    The combo box dropsdown and displays the records in my table but when I make a selection I get this error:

    Error : Script: On Change line:12
    topparrent.find(var_key_target)
    Conflicting expression data types

    The field being displayed in the combo box is a Claim Number. I'm not sure how to tell the combo box to use this value to find the matching Claim Number record in the form. I'm not sure what "goto record with specified key value..." means. Thanks for some direction. David

    #2
    Re: Combo Box troubles

    Hello David, Welcome to Alpha. Let's see if I can help a bit.

    Originally posted by Davidk View Post
    I've placed a combo box on a form for the purpose of displaying the fields in a table and, when a record is selected from the combo box, the record in the form should be found and displayed.
    A combo box will not display fields in a table but it will display the 'values of the field upon which the combo box is built.

    The combo box is defined as a Variable (clmlookup) defined through the combo box dialog. I've selected an Action script for the OnChange event... the xbasic code turns out to be this:

    'Goto record with specified key value in current form.
    DELETE var_key_target
    var_key_target = ClmLookup
    topparent.find(var_key_target)
    Which object is the OnChange event based? What are you trying to do here?

    The combo box dropsdown and displays the records in my table but when I make a selection I get this error:

    Error : Script: On Change line:12
    topparrent.find(var_key_target)
    Conflicting expression data types

    The field being displayed in the combo box is a Claim Number. I'm not sure how to tell the combo box to use this value to find the matching Claim Number record in the form. I'm not sure what "goto record with specified key value..." means. Thanks for some direction. David
    Is the claim number a character or numeric. I should be character. The only time it should be numeric is in a field where some form of math is needed. You are getting the error because the field is not the same as the variable and the field are not the same data type. If the field is numeric, the variable must be numeric.
    TYVM :) kenn

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

    Comment


      #3
      Re: Combo Box troubles

      Hello David,

      "goto record with specified key value..." simply means that you have told Alpha to look for a certain value (which you have supplied through the combo box and is stored in the ClmLookup variable) and to look for it in a particular place refered to as the key. The search key is determined by the current sort order. So if you want to search on claim number then the form needs to be sorted on that field. The error that you are getting is that the value you have specified is of a different data type to the current order key of the form. The default order if you have not specified one is the built in record number which is of type numeric.

      The order of the form can be set simply by selecting the claim number field on your form and using the sort buttons on the toolbar. You can experiment to see what the current sort key is by using the select index button on the Toolbar (which can also be used to set the index/current sort order.) Try sorting on different fields on the form and see what the index dialog shows.

      How ever you can incorporate this into the action script. If you don't have one already create an index on the claim number field. (right click on the table in the control panel and choose 'Define Indexes'). Then add an action in the OnChange event that occurs before the find action called 'Set Index' (found under the 'Index/Sort' category) choose the index that is based on the claim number field.

      The above behaviour and requirements is the same as if you open the find by key dialog from the toolbar(or ctrl k). You have to specify what to search by and what to search for.
      Tim Kiebert
      Eagle Creek Citrus
      A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

      Comment


        #4
        Re: Combo Box troubles

        Thank you, forskare, you helped put me on the right track.

        As you say, I did mean the field values. The OnChange is fired from the Combo Box. Most of my troubles with A5 will be with the way dbf tables and indexes work. I'm coming from many years with Access and try to get my head out of that box. I had a feeling that I was mixing datatypes and thus the error, so just set the index to the Claim number and it works. Thank you.

        David

        Comment


          #5
          Re: Combo Box troubles

          That was it Tim, thank you. I knew I was missing something just didn't know what. I needed to set the index first. Actually, the first thing I did was to try your Form/Sort suggestion. I just sorted the form based on the Claim # and then my Combo Box worked... yikes. Then I added the Set Index action script into the combo box OnChange and it's fine now. Excellent. David

          Comment


            #6
            Re: Combo Box troubles

            Originally posted by Davidk View Post
            Most of my troubles with A5 will be with the way dbf tables and indexes work. I'm coming from many years with Access and try to get my head out of that box. David
            Hi David,

            While I didn't work with VB, I did use Access. I had the same issues in that, when became stuck, I tried to do it the way I did it in Access which was a big mistake. I had to force myself to 'forget' Access. When I did, life with Alpha soon became a whole lot easier. I believe you'll do quite well with Alpha and will soon discover, if not already, that Alpha is really a lot of fun.

            kenn
            TYVM :) kenn

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

            Comment


              #7
              Re: Combo Box troubles

              Originally posted by forskare View Post
              Hi David,

              While I didn't work with VB, I did use Access. I had the same issues in that, when became stuck, I tried to do it the way I did it in Access which was a big mistake. I had to force myself to 'forget' Access. When I did, life with Alpha soon became a whole lot easier. I believe you'll do quite well with Alpha and will soon discover, if not already, that Alpha is really a lot of fun.

              kenn
              Agreed completely... I've reviewed the Alpha programming language and although I can understand what's going on there's no way I could just start coding. It's going to take some time. Overall, I know there a way to do something - e.g. the combo box stuff - and I know the Access stuff won't help me... I just have to keep digging until I find the Alpha way.

              Thanks again,

              David

              Comment


                #8
                Re: Combo Box troubles

                Originally posted by Davidk View Post
                I just have to keep digging until I find the Alpha way.
                Don't forget to use this message board. No matter how ridiculous you think your question may be, there is ALWAYS someone else who will benefit as well. And there's Action Scripting. Use that as a faster way to get most things done and it can be converted to code so you can see how the code is written.

                The best, kenn
                TYVM :) kenn

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

                Comment

                Working...
                X