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 Question

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

    Lookup Question

    I probably already know the answer here - but anyway -

    I have a jobcost table and an item table. I want to use lookups to get the value from the item table and populate fields in the jobcost table.

    If I use a field lookup - it will change the information in the file won't it - if that field used to do the lookup ever gets changed or if 'recalucate calculated values' is used won't it?

    I read somewhere about two different ways to do a lookup - and one of them might change the data in the future - but the other would not. I can't find that back again ...

    Can somebody tell me what I am thinking of?

    Thank you.
    Betty

    #2
    Re: Lookup Question

    Betty,
    Using a field rule table look up will not change the value of the field being looked up. So, I am not sure what your thinking of.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    Comment


      #3
      Re: Lookup Question

      I think what he's saying is that, if he uses a table lookup on the item table to fill in the job table, will the values in the job table change if the values in the item table are changed later. I don't think it will because a new lookup won't occur until someone attempts to change the value in the field calling for the lookup in the job table.

      correct me if I'm misinterpreting.

      Comment


        #4
        Re: Lookup Question

        Maybe this will help with the understanding....

        First, let's be clear for everyone that we are not talking about a "find record" situation here. I don't think the original poster was talking about that but I want to be sure it's clear for anyone reading this. I've been involved in other situations where this wasn't clear and caused a whole lot of confusion.

        There are two basic "lookups" that involve looking up a value (or values) in a table.

        The first one is a "field rule table lookup". This is a "built-in" lookup method that requires the user to click a drop-down icon on the field to select a value. This type of lookup also allows you to easily "import" (I use that term loosely here) other fields at the same time. For example, You might be selecting a client name and want to also bring the client number into the new record so the user could easily run a look up or sort by whichever one they have or are more comfortable with. This "field rule table lookup" is basically a "one time" thing - changing the data in one table will not affect the other in any way UNLESS the user actually clicks the drop-down and selects a different value.

        Sometimes a "lookupx" function (where "x" is actually C, N, or L) might be used in a calculated field. Example:
        lookupc( "F", Broker_Nof, "Brkr_namef", "Clients", "Broker_no_")
        This, I would hope, is extremely rare. In most cases it would be a sign of poor database design but I'm sure there are some cases where it makes sense. In this case, since it's a calc field, running the "recalculate field rules" action (or whatever it's called) would change the value if the value in the Clients table had changed. This is why it's not generally a good thing to use one of the lookup functions in a calc field.

        Even in the example above, it wouldn't be uncommon for a client to be assigned to a different broker. Or, if that particular client with the original broker number was deleted, the new value would be blank. Both situations would make a mess of the data which is why this usually isn't a good idea.

        Another place that I've mentioned I don't like to use a calc field (but I'm sure many still do it) is for "last update/change" dates. Many make this a calc field equal to "date()" but that will change whenever a global update is done or the "recalculate field rules" is run. The best solution I've found for this is to put a short script in the CanSave event:
        Code:
        tc = table.current()
        tc.change_dtf = date()
        Of course, you would replace "change_dtf" with your own field name.

        HINT: Always use the same field name in every table. That way you can just cut and paste the script. Or, you can save it as a keyboard macro as I do. I just type "jjchgdt" and the macro types my full script shown here:
        Code:
        tc = table.current()
        tc.change_dtf = date()
        IF eval_valid( "tc.change_tmf" )
            tc.change_tmf = left(time(),5)
        END IF
        'used only if a *script* creates the record but doesn't include the creation date:
        IF tc.create_dtf = {}
             tc.create_dtf = date()
        END IF
        (I really do find it hard to believe that so many programmers do not use a keyboard macro program. I'd go crazy without it.)

        Comment


          #5
          Re: Lookup Question

          Cal,
          Nice explanation.
          (I really do find it hard to believe that so many programmers do not use a keyboard macro program. I'd go crazy without it.)
          Is this something you have written with A5 or is this a third party addin? I'm nebulously envisioning that this could be done with an A5 UDF.
          Mike W
          __________________________
          "I rebel in at least small things to express to the world that I have not completely surrendered"

          Comment


            #6
            Re: Lookup Question

            Thanks.

            While it might be possible to create some kind of keyboard macro program in A5, it definitely wouldn't be worth the time it would take. (And I wouldn't know where to start.)

            The one I use is called Macro Express and costs $40 today. I will happily send a copy of my xbasic macros to anyone who buys it. And, in case you're wondering, my only relationship with them is that I bought a copy of their program years ago.

            Comment


              #7
              Re: Lookup Question

              So where's Betty to tell us if we got it right or not? I have to apologize because in my response to her I used "he's" instead of "she's".

              Comment


                #8
                Re: Lookup Question

                While I don't use a keyboard macro program like Cal. I do use Clipmate. It is a windows clipboard replacement that lets you create a library of commonly used clipboard items (in my case code I use all the time). It is a very nice program. The other thing it does is keep history of what you put into the clipboard using ctrl+c. Before Clipmate...I was constantly wishing I could have the item I put into the clipboard 3 or 4 clips ago. With Clipmate...that is no problem. Keeps a history of what you have put into the clipboard and you can go get them and reuse them. Very cool stuff IMHO.

                Regards,

                Jeff

                PS - Hey Cal......would you be interested in selling your message box code you posted recently in another thread?

                Comment


                  #9
                  Re: Lookup Question

                  Yes. Cal's explanation is the thing that I thought I had read.

                  Thank you.
                  Betty

                  Comment


                    #10
                    Re: Lookup Question

                    Originally posted by jkletrovets View Post
                    While I don't use a keyboard macro program like Cal. I do use Clipmate. It is a windows clipboard replacement that lets you create a library of commonly used clipboard items (in my case code I use all the time).
                    Doesn't anyone use the code library? Isn't that what it's for? It's always right there when your coding. I know that Cal's keyboard macros go way back before there was such a thing as a code library, but otherwise...???
                    Peter
                    AlphaBase Solutions, LLC

                    [email protected]
                    https://www.alphabasesolutions.com


                    Comment


                      #11
                      Re: Lookup Question

                      Doesn't anyone use the code library?
                      Actually Peter....I never even knew that was there!:o

                      The one benefit to Clipmate is that you can use it in any windows program....not just Alpha.

                      Comment


                        #12
                        Re: Lookup Question

                        Originally posted by jkletrovets View Post
                        Actually Peter....I never even knew that was there!:o

                        The one benefit to Clipmate is that you can use it in any windows program....not just Alpha.
                        That' ok. Every now and then I stumble across something that I didn't know was there myself. I think I used to have a copy of clipmate, or maybe it was something similar. But I highly recommend the code library!
                        Peter
                        AlphaBase Solutions, LLC

                        [email protected]
                        https://www.alphabasesolutions.com


                        Comment


                          #13
                          Re: Lookup Question

                          I was just reading the help file on it. It does seem to have some advantages. Kinda cool you can run Xbasic code directly by double clicking on an item in your code library!

                          Thanks for the head's up........

                          Comment

                          Working...
                          X