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

Matching lookup needs additional filter

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

    Matching lookup needs additional filter

    A table lookup with additional filter.
    The related table has many products, but I want the product based on accountno.
    accountno is in the receiving form and the account is in the source table.

    A sample picture is attached.
    I can not seem to write the filter for this job.
    Last edited by MikeData; 02-19-2011, 08:32 AM.

    #2
    Re: Matching lookup needs additional filter

    Hi Mike,

    You need to collect the value from the form (OnFetch event or any other event that sets the value to the variable) into a global variable then you can use it in the filter.

    See screen shot.
    Last edited by Keith Hubert; 02-19-2011, 08:55 AM.
    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: Matching lookup needs additional filter

      That will certainly work but what happens if the variable is deleted some day? I would suggest you use something like

      accno = if(is_object("receiving"),:receiving:accountno.value,"")

      or

      accno = if(eval_valid(var->variablename),var->variablename,"")


      assuming accno is character.
      Last edited by Stan Mathews; 02-19-2011, 12:47 PM.
      There can be only one.

      Comment


        #4
        Re: Matching lookup needs additional filter

        Hi Stan,

        Thanks for the alternative.

        Thats the power of Alpha, there is always more than one way to get the job done.
        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: Matching lookup needs additional filter

          Keith nice to hear from you. its being long.
          Thanks to Keith and Stan. But I like to mention that I am in the table field rules definition not in the form.
          Simple scenario:
          The torderproduct.dbf has account 1000, 1001....
          account 1000 has productname "monitor"
          account 1000 has productname "Hard drive"
          account 1001 has productname "Modem"
          The Tinvoiceitem.dbf has acc 1000, 10001
          I want to fill the "product field" in the Tinvoiceitem.dbf from the choices of torderproduct.dbf account 1000 monitor or hard drive.
          I already define productname and product as a link.
          I need to narrow the second part to only view/accept account 1000 in my dropdown.
          With a code that is something like:

          accno = torderproduct.dbf.account in the filter box

          What will be the right code?

          I am trying to follow Stan coding, but I question the "receiving"
          Should the code mention the table source?

          I hope my question is clear.

          Comment


            #6
            Re: Matching lookup needs additional filter

            Mike,

            You said

            accountno is in the receiving form
            Keith and I are assuming you want to use the lookup while you have a form open. I assumed the name of the form was receiving since that's what you called it.

            If the tinvoiceitems.dbf doesn't have any account number field you will have to supply the filter with an account number from somewhere else. This can be from a variable or a reference to a form field object. Either almost certainly means you have to have a form open as the source for that value. How you reference the account value you want to use is problematic.

            Think of opening the default browse for the tinvoiceitems.dbf and trying to use the lookup. Is there an account number field available?
            There can be only one.

            Comment


              #7
              Re: Matching lookup needs additional filter

              Please accept my appologies if I am not describing my needs properly.
              Correct I want use this in a form. When I mentioned receiving I was nicknaming a form for the table tinvoiceitem.
              The need is at the design field rules at the table level.
              Perhaps I am not clear.
              The question is what will be the code to add addtional filter to my oringinal link, product name and product.
              The original link will show at the dropdown field PRODUCT, all the products in the tordeproduct.dbf.
              I want to show the records associated with the accno only.
              The Torderproduct has a field called "acccount", this is the link that will narrow my search at the dropdown.
              This should happens if I am a form associated or in the table tinvoiceitems itself.
              Please look at the picture.
              Is it possible to add a filter at that level?

              Should I have a sample posted?

              Comment


                #8
                Re: Matching lookup needs additional filter

                You have fields in both tinvoiceitems and torderproduct that represent the account number? Then the filter is simply

                account_field_in_torderproduct = account_field_in_torderitems

                I think you have them reversed in yor original example. Should be

                account = accno

                You don't need

                torderproduct.dbf.account

                because torderproduct.dbf is the table being "looked into".

                This should happens if I am a form associated or in the table tinvoiceitems itself.
                NO. In the table tinvoiceitems itself how would the field rule lookup know what account value to use?

                Go to the interactive and try

                lookup("torderproduct.dbf","account = '12345'","productname")

                using values you know rather than 12345.

                You should get a response of some product name. The field rule does nothing more than this. The value 12345 in "account = '12345'" has to come from somewhere.
                There can be only one.

                Comment


                  #9
                  Re: Matching lookup needs additional filter

                  I can not seem to get it working. I am posting a sample db and the form to look at is re_pinvoiceform.

                  Comment


                    #10
                    Re: Matching lookup needs additional filter

                    Before I post the first time I did search and found nothing.

                    I have to apologize, I myself had this question about a month ago.
                    It was slightly different situation, but the same results.
                    I totally forgot about it.
                    As I was posting the sample I realize the similarity.
                    I searched and found the solution.

                    The solution is: at the filter just place this

                    Accno = tinvoiceproduct->account

                    Stan and Keith please forgive me for my mental absence.

                    Comment


                      #11
                      Re: Matching lookup needs additional filter

                      Do you see that

                      Accno = tinvoiceproduct->account


                      will be meaningless for the field rule if you are in the default browse or form for the table?
                      There can be only one.

                      Comment


                        #12
                        Re: Matching lookup needs additional filter

                        Stan, I did post incorrectly, thanks for bringing it up.

                        The correct code is: Accountno = tinvoiceitems->accno

                        The accountno is in the table torderproduct.dbf


                        This will work at the table and the form.

                        I can seem to get all my marbles together.
                        Attached is aworking sample

                        Comment

                        Working...
                        X