Alpha DevCon 2018
Results 1 to 5 of 5

Thread: Look up difficulty

  1. #1
    Member
    Real Name
    Brian Dennis
    Join Date
    Sep 2001
    Posts
    372

    Default Look up difficulty

    Hi,
    I want to use field rule look up to enter the value of a field in a look up table to a field in the table being entered.
    Both fields are character of the same length.
    I have gone thru the book and don't get it.
    When I enter the appropriate number to the linking field in the enter mode, then move to the field that should be looked up, there appears the selection symbol on right of that field. Clicking that gets me the pop-up window with the correct info in it, which I can select and use to fill in the field.
    I don't want the pop-up window, I want the field to be directly filled in with the looked up value.
    I'm sure I am missing something silly, but have playing with it for days with no result.
    Any help would be greatly appreciated,

    Brian

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,298

    Default RE: Look up difficulty

    Brian, there are 'lookup' functions which will do what you want, and there are 'lookup' field rules which you are using. They're different animals.

    The lookup 'field rules' come in several varieties (simple list, cascading list, table lookup, conditional table lookup, and previous values) and are described in the field rules chapter of the User's Guide (ch 5). These are all designed to popup a list of likely choices for the user to choose from. This is explained reasonably well in the user's guide.

    When you need to quickly find and retrieve a value from another table, using a quick search and retrieve based on a known value from the current form or script, you might want to use one of the Lookup() functions, discussed in the Functions list (Ch. 37) of the Xbasic Ref. Manual. The available functions are: Lookup(), LookupC(), LookupD(), LookupN() and LookupL(). These search an external table for the first record matching a filter expression you supply, and return the value from that external table that you specify. Each function will return the value that is found, and if the find fails, each will return a default value, specified in the ref. manual, so you that you script or expression will know that the lookup failed.

    -- tom

  3. #3
    "Certified" Alphaholic
    Real Name
    JohnZaleski
    Join Date
    Oct 2000
    Posts
    1,736

    Default RE: Look up difficulty

    Tom is correct about the lookup functions.They would work nicely as a default value.
    Your use of the lookup field rule however is somewhat backwards. Sounds like you have the lookup field rule on the field to be filled in. You should have the lookup field rule on the linking field and have it fill the other field automatically.

  4. #4
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,754

    Default RE: Look up difficulty

    Adding to John's comment...

    IF you define the linking field with a table lookup, you will see a browse list that has columns titled Source, Fill, Display, Width, and Condition. Simply fill in the info about the second field that you want to have filled in automatically.

    Let's assume you are looking up a customer number for field one. The first line would show the Customer_numb from the lookup table being filled into the Cust_numb field in the current table and, for example, the Customer_name from the lookup table being filled into the Cust_name field of the current table.

    With the Show and Condition fields, you have complete control over what the user sees in the lookup vs. what items get filled in. Quite often the user only needs to see 1 or 2 fields but many more might get filled in.

  5. #5
    Member
    Real Name
    Brian Dennis
    Join Date
    Sep 2001
    Posts
    372

    Default RE: Look up difficulty

    Cal,
    Without advice like this I would give up on the whole thing. It works like a dream, exactly what I wanted, Thanks a lot.
    Thanks a lot also to you Tom and John.
    I have another problem on this same table structure, but it is, I guess, a different kind of subject of field rules.

    Thanks a lot for your help

    Brian

Similar Threads

  1. import difficulty
    By martinwcole in forum Alpha Five Version 5
    Replies: 6
    Last Post: 01-08-2003, 04:51 AM
  2. Difficulty of Alpha Four?
    By Desmond Birch in forum Alpha Four Versions 7 and 8
    Replies: 8
    Last Post: 08-01-2002, 11:59 AM
  3. query difficulty
    By martinwcole in forum Alpha Five Version 4
    Replies: 2
    Last Post: 08-07-2001, 07:15 PM
  4. query difficulty
    By martinwcole in forum Alpha Five Version 4
    Replies: 3
    Last Post: 10-14-2000, 03:11 PM
  5. file copy difficulty
    By martinwcole in forum Alpha Five Version 4
    Replies: 12
    Last Post: 04-04-2000, 08:20 PM

Posting Permissions

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