Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old July 1st, 2004, 03:44 AM
agentcid agentcid is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 11 agentcid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Combobox - new Form load

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

Reply With Quote
  #2  
Old July 1st, 2004, 12:24 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 18 h 33 m 48 sec
Reputation Power: 180
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

Reply With Quote
  #3  
Old July 1st, 2004, 12:26 PM
spak111 spak111 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 349 spak111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 25 sec
Reputation Power: 5
Send a message via AIM to spak111
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.

Reply With Quote
  #4  
Old July 2nd, 2004, 04:05 AM
agentcid agentcid is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 11 agentcid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
..... 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

Reply With Quote
  #5  
Old July 2nd, 2004, 07:20 AM
spak111 spak111 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 349 spak111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 25 sec
Reputation Power: 5
Send a message via AIM to spak111
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.

Reply With Quote
  #6  
Old July 2nd, 2004, 04:17 PM
agentcid agentcid is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 11 agentcid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #7  
Old July 4th, 2004, 03:42 PM
agentcid agentcid is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 11 agentcid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Combobox - new Form load


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway