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

lookup on two fields in lookup table

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

    lookup on two fields in lookup table

    I searched the forum, the online help and the local help and couldn't find a direct answer to this question.

    I have a table with a field called Record that does a lookup to the Record1 field in a lookup table when I start typing in Record. This results in two fields on the table to be filled. Sometimes what I type is not in the Record1 field in the lookup table but it would be in the Record2 field in the lookup table. Is there anyway in the field rules to specify that if what I type is not found in Record1 then to go to Record2. If so, how would I specify that and how would I specify the fill-ins?

    I know I could do this with a conditional table lookup and simply having duplicate tables but thought I would ask.

    #2
    Re: lookup on two fields in lookup table

    No one can weigh in on this one?

    Comment


      #3
      Re: lookup on two fields in lookup table

      You might try a conditional table lookup with the same table specified twice. Not sure how the conditions would be written.

      Re-read your original post and see you thought of that. Probably the only way.
      There can be only one.

      Comment


        #4
        Re: lookup on two fields in lookup table

        Thanks for your reply. I think I could write an "if" type expression for the lookup to go to two different fields but then I get stuck on how to specify the fill-in information.

        I think for the contingency table lookup, I would make a copy of the lookup table and give it a different name and then use the two different names for looking up Record1 or Record2.

        I'll do the contingency table lookup.

        Thanks!
        Robert

        Comment


          #5
          Re: lookup on two fields in lookup table

          Okay, I'm totally lost. Not being a programmer, I just can't wrap my hands around this one. I downloaded a database with a conditional table lookup that Tom Cone posted a while back but it doesn't help me.

          I've attached a zip file (Tapetest) that contains database (Tapetest). This database contains the table Tapetest which is the master table. The lookup tables included are forty3 and forty4.

          Right now, when I'm adding data to the field called "Record" in the Tapetest table, I have a table lookup to field "Record1" in the forty3 table. When I hit the tab key after entering a little bit of data in the "Record" field, table forty3 fills in both the "Record" and "Artist" fields in Tapetest. Everything works perfectly. If there is more than one Artist with the same Record, then I just click on the button and select the correct one.

          The problem comes in when the data I type in doesn't exist in the "Record1" field. To enter this data, I have to edit the field rules to not use the lookup and add the data. This data does exist, however, in the field "Record2" in the forty3 table. What I wanted to do is have a conditional lookup so that, if the data wasn't in "Record1", then the lookup would be to "Record2".

          The options are to define a conditional lookup to either field in forty3 or to use a conditional table lookup with two tables. The Alpha help suggests using two tables so I created a duplicate of forty3 called forty4. I changed the name of the Record2 field in forty4 to Record1 and deleted the original Record1 field so that Record1 would be the lookup field in both tables.

          The alpha help suggests using the Exist() function as the condition expression for table forty3 and then just .T. for the condition expression for table forty4. It then goes on to say that you need to write an expression for each table in the lookup but doesn't give an example. My problem is that I don't know how to specify the proper variable in the Exist function. I also messed around with the contains() function but can't get this to work either.

          Can anyone help?
          Last edited by robert; 03-03-2009, 02:27 PM.

          Comment


            #6
            Re: lookup on two fields in lookup table

            Attachment not found, try again.
            There can be only one.

            Comment


              #7
              Re: lookup on two fields in lookup table

              Stan, I was trying to upload the zip while you were reading. I went to "manage attachments" and selected the file. I then clicked on upload and it said it was uploading the files, please wait. After 5 minutes, it said I wasn't logged in and if I typed in my login information, it said I couldn't access the post. Any idea what I'm doing wrong?

              Comment


                #8
                Re: lookup on two fields in lookup table

                Maybe too big? Max is 5 meg.
                There can be only one.

                Comment


                  #9
                  Re: lookup on two fields in lookup table

                  The zip is 1 meg. Apparently the files get decompressed on upload.

                  The files are attached.
                  Last edited by robert; 03-03-2009, 03:39 PM.

                  Comment


                    #10
                    Re: lookup on two fields in lookup table

                    Okay, where's the experts? The silence is deafening. If you had to write the code to do this you guys could probably write it in less than an hour. I'm just trying to do it within the confines of what Alpha provides.

                    Comment


                      #11
                      Re: lookup on two fields in lookup table

                      Didn't notice the post today. Will take a look tomorrow.
                      There can be only one.

                      Comment


                        #12
                        Re: lookup on two fields in lookup table

                        Stan- did you forget me?

                        I look at this as nothing more than an If-else problem. If what I type into "Record" in Tapetest is found in forty3, Record1 then fill in the specified two fields in Tapetest.
                        Else, look in forty4, Record1 and fill in the fields in Tapetest.

                        I just don't have the foggiest notion how to specify that using what's allowed in the condition table lookup field rules.

                        Comment


                          #13
                          Re: lookup on two fields in lookup table

                          Yeah, I did. Actually got wrapped up im my day job. Writing myself a note on paper now to get back to this.
                          There can be only one.

                          Comment


                            #14
                            Re: lookup on two fields in lookup table

                            Here's a conditional table lookup but it doesn't do what you want. A conditional table lookup looks at the value you type in and returns a corresponding value from one of multiple tables. It doesn't return two values.
                            There can be only one.

                            Comment


                              #15
                              Re: lookup on two fields in lookup table

                              It's causing the same problem as I had before.

                              When I used the canned Exist() and .T. that Alpha recommends in the help, it will go to table forty4 and fill in what I typed in "Record" and the Artist. I don't think it even looks at forty3, Record1.

                              But, when I type in something in "Record" that exists in forty3, Record1, it won't return the corresponding content of forty3, Record1 or the Artist. It also will only display the artist in forty4 when I go to the lookup even if I specify two fields in the lookup display.

                              The help says to use the same type of expression for each table you want to use as a lookup but as soon as you type in the second table with the .T. , that's the only table it will use.

                              I have to believe that hundreds of people over the past 20 years have used a conditional table lookup. Makes me wonder if I shouldn't go directly to Alpha with this one. I'm not even sure how to do that.

                              What do you think?

                              Comment

                              Working...
                              X