Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2005, 05:56 AM
Authorized User
 
Join Date: Apr 2005
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting to another form

I have 2 VB.NET forms, on Form 1 I have 4 dropdown lists and a submit button. The values in the dropdown lists come from a database, what I would like to happen and have tried to do is that the user selects values from the dropdown lists and then clicks on the submit button, once clicked, I would like to query the database and the relevant results are inserted into a dropdown list on Form 2, which has the dropdown list and a couple of radio buttons and a text box. Any help is greatly appreciated, many thanks in advance.

 
Old April 18th, 2005, 02:57 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Forms are global classes, and can be referenced as any class would be.
If you have a form frmX, with a drop-down list optZ, from any code in the application you can access that drop-down's methods and so on with frmX.optZ....

So you can use the drop-down's methods for adding new items within a loop in “Form 1” which reads the rows of the database.
 
Old April 19th, 2005, 03:57 AM
Authorized User
 
Join Date: Apr 2005
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My mistake sorry for not making my problem clear, what I have is a form, on it are 4 dropdown lists, so for example in DDL1 we select BMW, in DDL2 we select RED, in DDL3 we select R-Reg and in DDL4 we select 1-owner, when the user clicks on the submit button, I would like to query a database and return values that are true on a different form in a dropdown list as you may have more than one value returned. Hope that makes my problem easier to understand?






Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting to database stealthdevil Visual Basic 2005 Basics 2 November 5th, 2007 01:31 PM
Connecting to Oracle8i mcgarry101 Visual Basic 2005 Basics 0 February 13th, 2007 07:33 AM
Connecting to MSAccess swatishah ADO.NET 3 January 19th, 2006 12:08 AM
How to connecting java script form to xml file ashraf Javascript How-To 1 December 10th, 2004 05:47 AM
Help connecting!!! tim33_909 SQL Server 2000 4 November 5th, 2003 01:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.