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

Lookupc Field Rule Misbehaves??

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

    Lookupc Field Rule Misbehaves??

    I have a simple database where the Lookupc expressions works in one field rule but not the other.

    Field Rule 1:

    Dateshours table, CHILD field rules;
    Entered Lookupc( entered "F", selected Child from the Dateshours list of fields displayed above, selected Child from the Dateshours list of fields displayed above, Entered the table name Children and entered the index name Childid. Pressed evaluate, walla, it works.

    Field Rule 2:

    Dateshours table, PROVIDER field rules;
    Entered Lookupc( entered "F", selected Pvdrid from the Dateshours list of fields displayed above, selected Provider from the Dateshours list of fields displayed above, Entered the table name Providers and entered the index name Pvdrid. Pressed evaluate, Oooops, it doesn't work. No error message, nothing.

    I followed the same sequence in both expressions, the only difference is the names. In the data entry form, if you enter a date in the browse and press tab, the child's name appears but the provider doesn't appear.

    Any idea why one lookupc expression works and not the other? Zip file attached.

    Thanks for taking a peek.

    kenn
    TYVM :) kenn

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

    #2
    RE: Lookupc Field Rule Misbehaves??

    No zip to download?

    Comment


      #3
      RE: Lookupc Field Rule Misbehaves??

      Ken, there is no zip, so this is just a guess... Is it possible that the lookup is working? If there is no error message, then perhaps the lookup is yielding a blank?

      Try pressing evaluate several times to sequence through several records...

      Good luck.
      Pat Bremkamp
      MindKicks Consulting

      Comment


        #4
        RE: Lookupc Field Rule Misbehaves??

        Sorry for the misssssssed file. I really did go through the steps of attaching a file. Pat, I checked that out and even entered data and the looked at the default browse as well.

        I'll try it again.

        kenn
        TYVM :) kenn

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

        Comment


          #5
          RE: Lookupc Field Rule Misbehaves??

          Lookupc() is working just fine. Your report of its possible misbehavior is premature.

          I saw two problems with the second lookupc() expression you wrote:

          1) You were trying to match the value in the Pvdrid field of DatesHours table with the first Pvdrid field in the Providers table that had the same value. However, in DatesHours the field is 12 chars wide, while in Providers it's only 6 chars wide. A six char field will never match the values present in a 12 char field. You need to change the expression to trim trailing blanks, or simply restructure DatesHours so that it's the same size field as is used in Providers.

          2) You were trying to match the value in the Pvdrid field of DatesHours table with the first matching value in the Pvdrid field of the Providers Table, but all the Pvdrid fields in DatesHours were blank. Even if the table structures had matched the expression you wrote would return no match since there are no blank pvdrid fields in Providers.

          Once I adjusted the field width, and supplied sample pvdrid values to the DatesHours table the expression worked just fine.

          Comment


            #6
            RE: Lookupc Field Rule Misbehaves??

            Pat, your instincts were good. The problem was a mismatch in field widths, and the absence of key values with which to search. -- tom

            Comment


              #7
              RE: Lookupc Field Rule Misbehaves??

              Tom,

              1. The fields are now the same character length.

              2. I created a data entry form with the childid, child, pvdrid, provider and a date fields. Then I added embedded browses for the child, providers and dateshours tables. I entered data and the child and providers browses filled in as they should. The child name appeared in the dateshours browse but the provider name did not.

              You said, > This seems to be contrary to what I need and contrary to the manner in which the child expression works. It would seem to me that if data was entered directly into the provider field of the dateshours table there is no need for the lookup. The provider field in the providers table is supposed to supply the provider name to the provider field of the dateshours table as does the child's name.

              Thanks,

              kenn
              TYVM :) kenn

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

              Comment


                #8
                RE: Lookupc Field Rule Misbehaves??

                Ken, you shouldn't use angle brackets in your posts, unless you want to hide what's between them. It's an HTML thing.

                The syntax of the lookupc() method is not the easiest to keep straight. When the fieldnames in the two tables are identical it can also make it tough to keep straight.

                I can't read your mind, and don't know what it is you really want to do. However, the first expression you furnished, and the one you said was working correctly went like this:

                LOOKUPC("F",CHILDID,"Child","Children","Childid")

                This expression was used in a field rule for the Child field in your DatesHours table. This field is not User Entered. It's Calculated.

                Here's how I interpret what you are doing with this expression:

                1) Look to the value in the CHILDID field of the current Dateshours record, make a mental note of what it is (this is the second parameter);
                2) Open the "Children" table, set the index to "Childid" (parameters 4 & 5);
                3) Look for the first matching index key. i.e. the first record in Children with a Childid value that matches the Childid value in DatesHours (parameter 1).
                4) Return that value to the Child field in DatesHours (parameter 3).

                In short, the expression uses the current CHILDID value to find a match in the Children table, and return the child's name to the current field, Child.

                Your message then indicated that you were perplexed why the second lookupc() expression failed when it followed exactly same sequence. You speculated that the lookupc() method was misbehaving.

                When I downloaded your material and examined the second lookupc() expression I found that it read as follows:

                LOOKUPC("F",PVDRID,"Provider","Providers","Pvdrid")

                This expression was used in a field rule for the Provider field in your Dateshours table. This field is not User Entered. It's Calculated.

                Here's how I interpret what you are attempting with this expression:

                1) Look to the value in the PVDRID field of the current Dateshours record, make a mental note of what it is (this is the second parameter);
                2) Open the "Providers" table, set the index to "Pvdrid" (parameters 4 & 5);
                3) Look for the first matching index key. i.e. the first record in Providers with a Pvdrid value that matches the Pvdrid value in DatesHours (parameter 1).
                4) Return that value to the Provider field in DatesHours (parameter 3).

                In short, the expression uses the current Pvdrid value to find a match in the Provider table, and return the provider's name to the current field, Provider.

                When I examined the DatesHours table I saw that the Pvdrid fields were all blank. So step 1 above fails to do anything meaningful. I also saw that the field was twice as wide as the Pvdrid field in the Providers table. Even if Pvdrid values were present in the DatesHours table, there would never be any matches found in the Providers table because the index find is trying to find a 12 character wide match, and all the fields being searched are only 6 characters wide.

                When I made these changes and tested the data set you gave me the second field rule worked just like the first one. (Which is what I thought you were looking for, based on your first message.) Assuming values are present in the current Pvdrid field, they can be used with this expression to find a match in the Providers table, and the Provider name is returned to the Provider field in DatesHours. That was the goal of this exercise wasn't it?

                Perhaps your Pvdrid fields are still blank in Dateshours table, when the Provider field value is calculated?

                Perhaps you need to fill in those values (possibly with another lookupc()), before the Provider field value is calculated?

                Your field rule for the Provider field assumes the existence of valid values in the Pvdrid field of Dateshours, after all that's the value that's being 'looked up' in Providers table.





                Comment


                  #9
                  RE: Lookupc Field Rule Misbehaves??

                  Ken,

                  Anticipating the need to get the right Pvdrid value into each DatesHours record, I changed the structure of DatesHours table, to move Pvdrid ahead of Provider.

                  I created field rule for Pvdrid field in DatesHours table. Made it a calculated field. Used a Lookupc() method to retrieve the Pvdrid value from child's record in Children table.

                  Using the default form for DatesHours table, when a new childid is entered, three fields get filled in. Child (the name), Provider (the name), and Pvdrid (the id number).

                  My conclusion: lookupc() works fine.

                  Unzip the attachment to a separate folder. Do not mix it with your development work.

                  Comment


                    #10
                    RE: Lookupc Field Rule Misbehaves??

                    Tom,

                    Thank you for the zip file. Not sure I completely understand it all but I'm preparing a chart along with your post notes and will do some T&E research.

                    It does what I need. Thanks,

                    kenn
                    TYVM :) kenn

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

                    Comment


                      #11
                      RE: Lookupc Field Rule Misbehaves??

                      ***CORRECTION***

                      Parameter 3 (third argument) in the lookupc() method does not specify the destination to which the looked up value is returned, as I wrote.

                      Instead, it is the 'lookup expression' and specifies the value (in the found record in the lookup table) that is to be returned by the method.

                      -- tom

                      Comment

                      Working...
                      X