DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How to return a value from calling form

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    How to return a value from calling form

    [Originally posted by ASHRAF]

    I have a form module "Supplier" in which˙ Supl_code is key field combo box. When clicking on that Combo box i am opening another form (showing supl_code & supl_name). when double clicking on particular row, want to return supl_code to main form(SUPPLIER).
    Pls. advise me how to return that code.

    Thanks for ur help

    Ashraf

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:How to return a value from calling form

    [Originally posted by Ed Ardzinski]

    I would create a public variable to store the value selected in the second form, allowing the up to date value to be read int he first form after the selection is made in Form 2.

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:How to return a value from calling form

    [Originally posted by Emerson Racca]

    This actually is not hard to do.˙ First you need to pass the global variable Choice made in the Supplier form to the second form (shown as vbModal).˙ In the second form, the value of Choice is used to index the order of the list of the supl_code and supl_name.˙ When that record is located and double clicked using a list view, you assign that record information to the global variables created in the main form and then close the second form.˙ The key is creating global variables and using explicit declarations of the forms to pass information back and forth.˙ If you want to see code, give names of the forms, temporary holding variables of the record selected on the second form, the database connection, recordset name, etc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center