|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
I need help with a code which, when i click on a certain topic in a Combobox and click a Command button it pops up the information (which will be on another form e.g Form3)...
Can anybody help |
|
#2
|
|||
|
|||
|
You might look around sites like www.mvps.org for examples and tutorials.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
To do this, after user clicks on the command button, just open up the new form and pass the information to it:
form3.show form3.lblSample.label = cboComboBox.text You can reference anything on another form by using the form name then the control. If you need something more specific, please feel free to ask. |
|
#4
|
|||
|
|||
|
..... can you try to break it down...
I'm kind of a newbie... I've got Private Sub cmdStart_click() <In here I put the code which will activate the form from which the topic is related to e.g 1. Introduction is on Form3.> <In here I want a code to close down the original form e.g Form2> End Sub Thanks in advance |
|
#5
|
|||
|
|||
|
Okay, well first you'll want to start out with opening form3:
form3.show Not exactly the same as an open statement, but will work much the same. If the form is not open, it will open it so that it can be shown. Next, pass whatever information you need to the new form. I would suggest having some sort of hidden label somewhere on form3 to pass a value to. Depending on exactly what you are doing depends on what would be the best way to do this: form3.lblID.caption = cboCombobox.text Then at this point, you may actually want to use a timer control to initiate whatever you want form3 to do. If your pulling a record from a database or just setting labels, it would be easiest to put it the code in a timer control and enable it from form2 instead of writing all of the code in form2: form3.timer1.enabled = true Then, all you need to do is close the current form, which would be form2. Now, if you will be coming back to the current form, you might as well hide it (me.hide). However, if the user may not be coming back to the form then close it (close me). I'm hoping this helps. |
|
#6
|
|||
|
|||
|
I typed in that code and it came up with:
Method or Data Member not found It was highlighting Form3.(lblID).Caption = cboCombobox.Text the bracketed part of the code above. Still very unsure mate.... I've got the whole open and close thingy... but it needs to open a certain form not just one, the form will already have all the information on it. So I need a code that will recognize what topic the user chose and take them to the form with that information on it. |
|
#7
|
|||
|
|||
|
thanks for your help spak111, but I found out how to do it.
Private Sub cmdStart_click() If Combo1.text = "1. Basic Atomic Structure" Then Load Form3 Form3.Show Form2.Hide End Sub Thanks anyway man, I used this which I got out of a Visual Basic book and it worked. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Combobox - new Form load |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|