Alpha Video Training
Results 1 to 12 of 12

Thread: Has anybody designed there own lookup

  1. #1
    Member
    Real Name
    Dick Anderson
    Join Date
    May 2006
    Location
    Milwaukee, WI
    Posts
    100

    Default Has anybody designed there own lookup

    What to do if you don’t like the way the lookup function works?

    When the lookup window opens up I should be able to press a key on the keyboard; new data should appear in the window and I should be able to continue making key presses until what I’m looking for is highlighted. If it is not in the lookup table I can select new.

    After I press the Enter key the lookup window should close and I should be returned to my entry form.

    If the record was found the fields on the entry form will be filled and cannot be edited. If the record is new I can fill the record on my entry form. Once the record is saved it cannot be edited on my entry form.

    What do I do? Put a button on my entry form and script my own lookup or use A5’s procedure but script intervention to change the operation?

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

    Default

    when you have the lookup tab open on field rules tick the display as a drop down option, then try it. Typing will progressively find your record. Then the data entry tab can be used to define which fields can be accessed.

    Lance

  3. #3
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default Mnay options

    Quote Originally Posted by Dick Anderson
    What to do if you don’t like the way the lookup function works?

    When the lookup window opens up I should be able to press a key on the keyboard; new data should appear in the window and I should be able to continue making key presses until what I’m looking for is highlighted. If it is not in the lookup table I can select new.

    After I press the Enter key the lookup window should close and I should be returned to my entry form.

    If the record was found the fields on the entry form will be filled and cannot be edited. If the record is new I can fill the record on my entry form. Once the record is saved it cannot be edited on my entry form.

    What do I do? Put a button on my entry form and script my own lookup or use A5’s procedure but script intervention to change the operation?
    Dick,

    The filed rule lookup offers a robust lookup process, but with dialog boxes and embedded browses on forms, you can generate elaorate look up actions with many custom filtering processes, and button-based responses. A simple one is attached.

    Mike W

  4. #4
    VAR
    Real Name
    Cheryl Lemire
    Join Date
    Jul 2003
    Location
    Pembroke Pines, FL
    Posts
    2,914

    Default no attachment

    Mike

    I don't see any attachment :(
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

  5. #5
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default oops

    Attached example:

  6. #6
    Member
    Real Name
    Dick Anderson
    Join Date
    May 2006
    Location
    Milwaukee, WI
    Posts
    100

    Default

    Thanks Mike

    I suppose the operation is run by the scripts I found on the form. That is; If I study the scripts, I too can recreate this type of lookup. Right?

    Dick

  7. #7
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,212

    Default one of many ways

    Dick,

    The example was just one of many ways to get to a lookup table. There are others. Yes, if you look at the scripting you can follow the process and get understanding of the steps to that example end. That's how many of us move forward.

    If the record was found the fields on the entry form will be filled and cannot be edited. If the record is new I can fill the record on my entry form. Once the record is saved it cannot be edited on my entry form.
    For this look to 'Disallow Edits'.

    Look forward to helping as you might need.

    Mike W

  8. #8
    Member
    Real Name
    Dick Anderson
    Join Date
    May 2006
    Location
    Milwaukee, WI
    Posts
    100

    Default

    Thanks again Mike

    I've been working with the example you sent me. I didn't notice before that it doesn't use a series of keystrokes. If I want to find "KEY" typing in KE might highlight "ENTRANCE". Also: When the list comes up in the list box it doesn't always start at the top of the list. If I type a letter that nothing in the list begins with, it won't even try to come close to finding a selection.

    Is using keystrokes an intended part of the script or just something that happens?

    Dick

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

    Default

    Dick, to progressively narrow the search with each succeeding keystroke a different approach is required. Mike's is searching for the first letter, which is often all that's needed.

    Suggest you click the Resources Link, visit the Newsletter Archive, and search for the article on Progressive Lookup. Jim Chapman did a couple of tutorials there which will show you how to create a "progressive lookup".

    --- tom

  10. #10
    Member
    Real Name
    Dick Anderson
    Join Date
    May 2006
    Location
    Milwaukee, WI
    Posts
    100

    Default Thank you everybody

    I downloaded a tutorial from Alpha Software "using A5" by Jim Chapman which demonstrates a progressive lookup.

    Dick

  11. #11
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,644

    Default

    Dick

    Look at the code archive to get a later version that is more efficient..

    http://msgboard.alphasoftware.com/al...ad.php?t=57089
    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.

  12. #12
    Member
    Real Name
    Garry M Flanigan
    Join Date
    Jul 2004
    Location
    Melbourne, Australia
    Posts
    909

    Default

    Note that there is a slight problem with Jim's code as the last record is not displayed in the built list. The following section has an error:

    Code:
    function BuildList as c (vTable as p,vIndex as p,vCount as n)
    	BuildList = ""
    	for i = 1 to vCount
    		vKey = vIndex.key_get()
    		BuildList = BuildList + "{data="+padl(alltrim(str(vKey.record)),10,"0")+"}"+ vKey.key + crlf() 
    		vTable.fetch_next()
    		if vTable.eof(vIndex.name_get())
    			exit for
    		end if 
    	next
    end function
    It should be:
    Code:
    function BuildList as c (vTable as p,vIndex as p,vCount as n)
    	BuildList = ""
    	for i = 1 to vCount
    		vKey = vIndex.key_get()
    		BuildList = BuildList + "{data="+padl(alltrim(str(vKey.record)),10,"0")+"}"+ vKey.key + crlf() 
    		if vTable.eof(vIndex.name_get())
    			exit for
    		end if
    vTable.fetch_next()
    	next
    end function
    The vTable.fetch_next() is moved to the correct place. This is very easy to use. Refer to the article mentioned in the earlier post to get the entire code. Also, consider using the progressive lookup detailed in the A5V7 "Learning XDialog" sample application. It takes more work to set up but is more flexible and can show more columns.

Similar Threads

  1. How to Create browse designed by me
    By salah in forum Alpha Five Version 7
    Replies: 9
    Last Post: 11-10-2005, 12:44 PM
  2. lookup
    By bmann3 in forum Alpha Five Version 6
    Replies: 5
    Last Post: 09-07-2005, 10:56 AM
  3. LOOKUP won't lookup
    By brett s in forum Alpha Five Version 5
    Replies: 25
    Last Post: 10-25-2002, 05:38 AM
  4. One-Many Lookup
    By MIKE LYON in forum Alpha Five Version 4
    Replies: 2
    Last Post: 07-21-2001, 09:52 PM
  5. Lookup
    By Nigel Waters in forum Alpha Five Version 4
    Replies: 5
    Last Post: 05-18-2001, 08:29 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
  •