Alpha Video Training
Results 1 to 8 of 8

Thread: Open Form from a Grid

  1. #1
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Unhappy Open Form from a Grid

    Hi All

    I've built a desktop form (search_form) that contains a search grid supercontrol (grid_customer_search.a5wcmp).

    How do I code the onDblClick row event to open the relevant customer details in my desktop customer form (customer_form)?

    Both the grid and the form contain the customer ID field (cust_id), so I'm assuming this will be my linking factor.

    Any help will be very appreciated.

  2. #2
    "Certified" Alphaholic Clunes's Avatar
    Real Name
    Mark Pearson
    Join Date
    Jan 2010
    Location
    Brisbane, Queensland, Australia
    Posts
    1,001

    Default Re: Open Form from a Grid

    Not sure about grids for this, but why don't you look at a listview for this task? I use them all the time. You can build an xdialog with a textbox and listview using the genie. The textbox can filter the listview on multiple criteria and then the listview returns the unique ID for the customer to take you the form. attached is a zip file with a demo movie of where I use that in an inventory management program

    demo.zip
    -----------------------------------------------
    Regards
    Mark Pearson
    mark.pearson@onestopsolutions.com.au
    Youtube channel
    Website

  3. #3
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,369

    Default Re: Open Form from a Grid

    Melvin, I'm a fan of Dynamic Trees, so if you need to identify Customers in a particular town/city/street, then it's easy to do.
    Mark's suggestion will work well.
    Another option is a ReadOnly Browse - based on the Table or Set in use - with say, Client_ID and Name or other identifying data, and as you click on the line, the main form automatically displays the main record.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  4. #4
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Open Form from a Grid

    Thanks Mark and Ted for your feedback.

    I really want to keep the search grid as it works great with in my application.

    Is there any way to open a desktop form from an embedded grid?

  5. #5
    "Certified" Alphaholic Ray in Capetown's Avatar
    Real Name
    Ray Hendler
    Join Date
    Jan 2009
    Location
    South Africa
    Posts
    2,036

    Default Re: Open Form from a Grid

    Post your example and you will much more likely get a solution. I use methods as Ted and Mark suggest - mainly because of downward compatibillity and they work.
    If no-one uses the method you describe for search , that would involve having to create something, and it might not be like yours.

  6. #6
    Member
    Real Name
    Melvin
    Join Date
    Nov 2011
    Posts
    133

    Default Re: Open Form from a Grid

    Hi Ray

    Thanks for the suggestion.

    Here is an example of what I'm trying to build.

    I want to be able to click on either a link, or double row click, on a customer in the grid and then open the corresponding custoemr form.

    grid.zip

  7. #7
    "Certified" Alphaholic Clunes's Avatar
    Real Name
    Mark Pearson
    Join Date
    Jan 2010
    Location
    Brisbane, Queensland, Australia
    Posts
    1,001

    Default Re: Open Form from a Grid

    While someone gets your solution, I have taken your db and added a code. Unzip the attached, run the code from the code tab, enter into the text box data to filter your list, selct the customer and click next.

    this is simply an alternative to your grid

    demo.zip
    -----------------------------------------------
    Regards
    Mark Pearson
    mark.pearson@onestopsolutions.com.au
    Youtube channel
    Website

  8. #8
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,369

    Default Re: Open Form from a Grid

    Melvin, I'm sorry but I'm not clear what you are trying to achieve this way. The grid takes too long to load, and I'm not sure that having just an embedded grid component is sufficient.
    I got the impression that the grid was intended to work like a browse, so you might try adding the customer lookup data on the form outside of the grid.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

Similar Threads

  1. Open form in design mode, change 1 object property, save form, close form with xbasic
    By Mike Wilson in forum Alpha Five Version 10 - Desktop Applications
    Replies: 8
    Last Post: 12-27-2011, 01:39 AM
  2. How to fire field's lookup grid or open popup grid on new record event?
    By eritovs in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 11-03-2010, 12:35 PM
  3. Using form caption instead of form name on open form tabs at screen bottom
    By rmcgaffic in forum Alpha Five Version 9 - Desktop Applications
    Replies: 6
    Last Post: 05-12-2008, 08:43 AM
  4. Double click on grid to open another form/browser with relevant details
    By georgefurnel in forum Alpha Five Version 7
    Replies: 1
    Last Post: 10-08-2006, 12:06 PM
  5. Newbie - Open 2nd form form 1st form w/record
    By Ron Schwartz in forum Alpha Five Version 5
    Replies: 2
    Last Post: 01-24-2003, 08:46 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
  •