Alpha Video Training
Results 1 to 18 of 18

Thread: how do I code lookups properly?

  1. #1
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default how do I code lookups properly?

    Sounds a daft question, but it is one I have never been able to solve.

    The Majority of my tables have lookups defined in one way or another using a unique identity field which I use in to get values from the lookup table with no problem. The only way I have found to get it to work is by defining the lookup field rules on the unique field itself and then add calculated fields to display the correct value in my Browses and Forms. Is there a way of setting up table lookups that will make the relevant unique fields invisible in the lookup process?
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  2. #2
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,441

    Default Re: how do I code lookups properly?

    Hi Graham,
    Attached is a jpg, this is a basic lookup in field rules.

    Items available from suppliers are kept in a table called comparisonsheet1.

    We use a standard set as the purchase order which is purchase header ==> purchase items.

    In the purchase items table there is a lookup which is linked to the comparisonsheet1 table item_no field. The lookup source is comparisonsheet1->item_no which fills in but doesn't show the product_id field in the pruchase items table. the next source is the comparisonsheet1->name field which shows but doesn't fill in, therefore all the end client see is the name of the product not the item no. There is also a fill but dont show for the full description field in the purchase items table.

    Hope I have made this clear and it helps.

  3. #3
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default Re: how do I code lookups properly?

    Sorry Lance,

    cannot read the info on the JPG, image too small and when I zoom in it quickly becomes pixelated and unreadable.

    dis regard, I can read it.

    that seems to be the same as I have coded at the moment. see attached screen captures.

    I'm still not sure how I can do these lookups on the op_unique and b_unique fields without actually displaying them on the underlying form?

    example 1 for op_unique field and example 2 for b_unique field
    Last edited by Graham Wickens; 03-30-2007 at 11:56 AM. Reason: clarity
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  4. #4
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,441

    Default Re: how do I code lookups properly?

    Graham,

    Presumably the field below each of the op_unique and b_unique lookup fields are the calculated fields you mention in your first post?

    Is your logging master form based on a set?

    If so can you send all tables from that set plus appendix_c.dbf and base_details.dbf and I will construct what you want.

  5. #5
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default Re: how do I code lookups properly?

    Ok, it took a while but I think I have everything in the attached zip file.
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

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

    Default Re: how do I code lookups properly?

    Graham, are you talking about table lookups defined in field rules? or, possibly, something else? Does your example database include instructions for us to follow to find the relevant form / script / lookup ? what version of Alpha Five is being used?

    Later...
    Well, I've answered one of my questions. You've given us no crumbs to follow to get to grandmother's house. Too bad.

    -- tom
    Last edited by Tom Cone Jr; 03-30-2007 at 08:10 PM.

  7. #7
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default Re: how do I code lookups properly?

    Certainly am, is there another way then that I am unaware of? maybe that is my problem.

    In the example there is a form "Logging_Master" where I have highlighted the unique fields and the corresponding calculated values.
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

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

    Default Re: how do I code lookups properly?

    I'm sorry. I don't understand the question. Would like to help, but will need a single specific explanation of your goal, explaining in detail how you've attempted it thus far, using actual table, form, and field names. Maybe others more intuitive than me can help, but I need you to hit me over the head with specifics.

    -- tom

  9. #9
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,441

    Default Re: how do I code lookups properly?

    Graham,

    Is this what you are after?

    All I did was swap the lookup to a drop down box

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

    Default Re: how do I code lookups properly?

    Graham, if your data entry folks can find the operator based on its name, and not its op_unique field value, why not use a "coded lookup"? This would cause the operator name to display instead of the op_unique field value. Search help for "Coded Lookup" for more details.

    -- tom

  11. #11
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default Re: how do I code lookups properly?

    OK, I think I've got it now!!

    I changed my field lookups to "Display as Drop Down List" and that appears to be what I want, the Unique field value has disappeared and I get the BASE_NAME displayed instead of the unique value.
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

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

    Default Re: how do I code lookups properly?

    Graham, I'm glad you have it sorted. Sorry to have been so obtuse.

    -- t

  13. #13
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default Re: how do I code lookups properly?

    I have hit one small problem, If I want to delete a value from the lookup field ie the underlying Unique value used in the lookup, the system wont let me, it just puts the value back in the field when I try to save it or tab to another field. So how do I now delete the value if and when required?
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

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

    Default Re: how do I code lookups properly?

    Please post a current copy of the database, with instructions for us to follow to find and see the problem. -- tom

  15. #15
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default Re: how do I code lookups properly?

    Attached is the updated example database zip file.

    1) Open "Master File" Browse

    2) Try and delete value "Heathrow International" in the "Aircraft Operator" field where REG = "G-EUUO" or try and delete duff entry "B0005112" for "aircraft Operator" where REG = "G-DOCL". They wont delete!!
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  16. #16
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,441

    Default Re: how do I code lookups properly?

    Graham,

    Use the delete key not the backspace key, may need two pushes, depending on you exact setup but then you end up with a null entry in the field.

  17. #17
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    795

    Default Re: how do I code lookups properly?

    Hi Lance,

    I tried both <BACKSPACE> and <DELETE> but the value remained after tab to new field or record ?? Eventually using trial and error, I found that typing a <Space> in the field got me an empty field value!!
    Must be something odd in my setup!
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  18. #18
    "Certified" Alphaholic Lance Gurd's Avatar
    Real Name
    Lance Gurd
    Join Date
    Jun 2005
    Location
    Southampton, UK
    Posts
    1,441

    Default Re: how do I code lookups properly?

    so long as it works is my motto every time Graham

Similar Threads

  1. Can someone tell me how to code sets properly
    By Graham Wickens in forum Alpha Five Version 6
    Replies: 9
    Last Post: 01-15-2006, 07:51 AM
  2. Properly Refilling a browse
    By lake trash in forum Alpha Five Version 7
    Replies: 5
    Last Post: 12-12-2005, 07:40 PM
  3. Index not sorting properly
    By Wanda Tucker in forum Alpha Five Version 5
    Replies: 3
    Last Post: 04-16-2004, 09:11 AM
  4. Tables are not communicating properly
    By Rick Canady in forum Alpha Five Version 5
    Replies: 2
    Last Post: 12-29-2003, 02:55 PM
  5. Setting up my Set properly?
    By Bob Elliott in forum Alpha Five Version 4
    Replies: 4
    Last Post: 02-19-2001, 10:18 AM

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
  •