Alpha DevCon 2018
Results 1 to 14 of 14

Thread: Is lookup the right choice to select & fill fields with 2 fields

  1. #1
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    900

    Default Is lookup the right choice to select & fill fields with 2 fields

    I have read and download a few of samples of how to fill fields in a from another table.
    Normally alpha have a script with a combo box (the list is data from another table)and fill other fields. like in case Of customer form you have a field zip and a table called zipcodes. Open the field zip in customer and the list of zipcodes are shown to be displayed, once selected the script will help to populate fields like city and St from the zipcode table.
    My case is that I have 2 fields to select data from another table.
    The first is easy , the Entryno is the same as a lookup dropdown and will fill the entryno in the calling table. The second field is a simple list. Once selected I have created a set of choice statement to lookup the data matching the entryno selected above. Here is my problem I have no idea how to add to the choices what record to chose.

    I belive that at ".t." in the choices is where it should be a description for matching.
    The table addresschoice table have the field selectadd with formulas.

    I have not been able to understand the proper syntax, Hope I can get some advice.

    Question 1: what will it be the syntax at ".t." position?
    Question 2: Is this the right option of lookup?
    Question 3: Is there a better way of combo box to narrow the selection of addresses in the order table?

    I have attached a sample DB.

  2. #2
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    Hi Mike,

    The heading of this post is "Is lookup the right choice to select & fill fields with 2 fields", well the simple answer is Yes.

    I can see that you are trying to look up the customers address but what fields are you wanting to fill? The way you have it now, looks to me, back to front.

    At the moment what you have here will never work the way you want.

    Sorry if this sounds a bit gruff, but I really would like to help you.

    Do you have Skype?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  3. #3
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    900

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    Sorry I do not have Skype. I will look into shortly. Actually It is not that strange what I am trying to do.
    Keith sometimes even for us developer we fail to express our meanings. Perhaps I did not express myself correctly or complete. I did type a lot and failed. Oh Boy!
    The form Orderform has an entryno field and 4 addresses.
    I want to select from the addchoiceform select specific record (entryno is the key field) in the orderform.
    Then continue to select out of that record one of those address in orderform by a simple list.
    Then fill the field addresselected with choice of the orderform that has the 4 addresses. add1 or add2 or add3 and so on.
    Hope to be clear this time.

    Remember Alpha makes very easy to fill fields when looking at other tables with combo boxes, for selecting & filling the proper fields. when you use a simple list you do not have such simple process.

    Pleas take a look at the field rules of the addressselect field in data entry of the table addresschoice table.

  4. #4
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    Hi Mike,

    I have tested the Conditional Table Lookup and this will do just what.

    The conditional table lookup is built exactly the same way as the table lookup but you can select different fields to be displayed in the dropdown. Even though you can select the same table to lookup it will be based on a different condition.

    Good luck with your application conversion.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  5. #5
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    900

    Default Re: Hope to find a better lookup and combo process.

    Keith I found that the conditional table did not finish the job the way I was hoping. Here is a new approach, cleaner and easier design to be understood to a lookup table and lookup simple list process.
    This process works. I hope there is a better process.
    There is a full description in the attached db form.

  6. #6
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,784

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    Here are a couple of alternatives.

    I have kept your basic structure but another way which is more inline with database normalization would be to store the addresses in a separate table with each record only holding one address. Then have an id field that would link it in order to identify which name it belongs to. You could then use the standard lookup with a filter to provide the choices. This would also allow you to have more or less addresses for each name.
    Tim Kiebert
    Geelong Citrus Packers
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  7. #7
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    900

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    Brilliant!!!! That is what I was hoping for. Thanks Tim.
    Sample 2 is very good, but I like sample 3. Smooth & slick.
    And for gravy, a fantastic lesson in the use of those commands.
    I could not ask for more.

    Thanks again. Hope this thread will help other with this situation, which I think it could be magnificent in many applications.

    There are places, websites and Alpha itself to find help on this program, or videos and of course, this forum offers a lot, a lot!. I wonder if any one could compile some samples like this one and attach them to the list of commands accordingly.
    Something titled "Cases with Solutions". I would like to see something like it. The manuals are ok, but do not fully simplified the command use. Samples like this one, open up a whole new set of opportunities to other uses. Also in the description it should give credit to those who gave the solution in the sample.


    Is this available anywhere by any chance?

  8. #8
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,481

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    Quote Originally Posted by MikeData View Post
    Brilliant!!!!
    I wonder if any one could compile some samples like this one and attach them to the list of commands accordingly.
    Is this available anywhere by any chance?
    I'll host it if you put it together...

    What a great learning excercise..
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  9. #9
    "Certified" Alphaholic Tim Kiebert's Avatar
    Real Name
    Tim Kiebert
    Join Date
    Jul 2004
    Location
    Geelong, Victoria, Australia
    Posts
    2,784

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    Mike, glad you were helped by it.

    There are a couple of code errors in sample ...test3.zip :o

    In the Entryno form object OnChange event
    If t.fetch_find(this.text) then
    should be
    If t.fetch_find(this.text) > 0 then

    and

    In the form's OnFetch event
    If t.fetch_find(topparent:Entryno.text) then
    should be
    If t.fetch_find(topparent:Entryno.text) > 0 then
    Tim Kiebert
    Geelong Citrus Packers
    A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

  10. #10
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    900

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    I just went back and tested without this changes and it works fine.
    Tim I will make the changes as suggested.
    Thanks again.

  11. #11
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    900

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    Quote Originally Posted by Al Buchholz View Post
    I'll host it if you put it together...

    What a great learning excercise..
    I am game for it. You are right, It could be a fantastic learning experience.

    I will start putting some ideas together.
    Perhaps any one else could contribute some suggestions.
    Should we start a new THREAD about?

  12. #12
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    900

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    I just realized that we have a "Code Archive" and "Database design" here in this forum. Perhaps all we need is to add the cases with the samples and pertinent data. Perhaps create a format for submission.

    Is this the right place?

  13. #13
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,907

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    Mike,
    If I am reading your suggestion correctly, this is something that many of us have been doing on our own basically and it acts as a personal help file. I mentioned this in another thread about how there are so many samples and script snippets on this messageboard and that how they serve me and others very well in learning about various aspects of Alpha. My file has only been accumulating over the last couple of years so may not be the biggest or the most extensive compilation of them--400 or so sample databases and over 500 text code/script snippets (many redundancies however). I really need to organize them better but is not a high priority as they seem to serve my purpose as is so far.

    Is the above somewhat what you are referring to? Or maybe a much more documented example for each situation or task? An enormous project if the latter!
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  14. #14
    Member MikeData's Avatar
    Real Name
    Mike Data
    Join Date
    Nov 2008
    Posts
    900

    Default Re: Is lookup the right choice to select & fill fields with 2 fields

    Quote Originally Posted by MikeC View Post
    Mike,
    Is the above somewhat what you are referring to? Or maybe a much more documented example for each situation or task? An enormous project if the latter!
    MikeC You are correct the task could be humongous. Some how before we start we should define the scope of the project.

    Like you, I have started a collection of help items, Forum section clips, Forum code samples, videos from Alpha, some extracts from the training manuals, and or course sections of the manuals. Script here, script there.

    What I visualize is a compendium of cases and scenarios evolving into a final solution.
    Also I would like to see a display of real sample use of some of the codes that Alpha has in its inventory.
    Chances are some even I, may already know about. (Every days is a new learning adventure with Alpha)
    In your case even more. Yet the concept of reviewing cases with samples is very attractive.

    Some times I found very difficult in explaining what I want to accomplish. I am sure must of us have felt at some time or another in same situation, specially like putting key words to search in the forum.
    Many times the returns of the search are not even close to what we are looking for. Cannot blame the forum software. It is fact of the system.

    Some of the things to organize will be like:
    A way to use tag words to bring what we are looking for and not fall in the same situation we are now in the forum.
    A formula or a fill in form with details like key words, description of the case/scenario, problems encountered, a copy of the original database/app. And/or the final database/app. And an explanation of the solution.
    Sounds like a lot, but it could be simplified to be doable.

    It is going to required help from the entire Alpha community.
    I see a few drawbacks. Perhaps we can overcome them.

    Can we put these ideas on the table and come up with a framework?
    Can we start by doing some announcement at the header of the forum?
    Does any one with good writing skills volunteer and start the concept?
    “No matter how long the journey is, it always starts with the first step”.
    (I don’t know who said it)

Similar Threads

  1. A5, V4.5, do not fill all the fields in table lookup
    By jrtarrago in forum Alpha Five Version 4
    Replies: 3
    Last Post: 11-10-2008, 03:08 PM
  2. Find by Key now missing choice of fields
    By rweiss in forum Alpha Five Version 8
    Replies: 16
    Last Post: 11-05-2008, 10:11 AM
  3. RTM fields & filling in a field after a lookup
    By dchiass in forum Web Application Server v7
    Replies: 0
    Last Post: 12-29-2005, 03:59 PM
  4. Lookup table and fields to fill
    By rleunis in forum Alpha Five Version 6
    Replies: 1
    Last Post: 09-16-2005, 03:13 AM
  5. Table Lookup & Calc Fields
    By Michael Lanzieri in forum Alpha Five Version 4
    Replies: 0
    Last Post: 05-18-2000, 06:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •