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:
  #1  
Old June 21st, 2005, 02:20 PM
Lunchbox Lunchbox is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 1 Lunchbox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m
Reputation Power: 0
Userform ComboBox Problems

I can't seem to pinpoint the command to let me link one combo box to another so that when I select a certain option it will enable ComboBox2 I have on the userform, and if I select something else it will enable ComboBox3 on the userform. I have figured out how to do this with option buttons, but the combo box always has baffled me.

Reply With Quote
  #2  
Old June 21st, 2005, 03:02 PM
jacosta00021 jacosta00021 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 134 jacosta00021 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 39 m 31 sec
Reputation Power: 5
Thumbs up

Quote:
Originally Posted by Lunchbox
I can't seem to pinpoint the command to let me link one combo box to another so that when I select a certain option it will enable ComboBox2 I have on the userform, and if I select something else it will enable ComboBox3 on the userform. I have figured out how to do this with option buttons, but the combo box always has baffled me.


in the controlsource of your comboboxes is where the magic happens. Your "combobox1" will not need to be altered. However, the controlsource of the "combobox2" will need to be queried based on the first combobox. where the two comboboxes are related(ID, most likely), you need to make the combobox2 controlsource field equal to the combobox value on your form. so, for example, if you are basing your connection on the id in the table, then you would make the ids equal. in the controlsource query for combobox2(in the "criteria section), just say =forms![formname]![comboboxname] for the id, or whatever you are comparing. then, all you have to do is go into the code for the onclick event for combobox1 and say combobox2.requery. this tells combobox2 to "refresh" when you click on the first combobox.
kinda hard to explain. let me know if it makes sense for ya

*j

Reply With Quote
  #3  
Old June 28th, 2005, 07:33 AM
snipered's Avatar
snipered snipered is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2005
Location: Birmingham, England
Posts: 909 snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level)snipered User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 Days 20 h 48 m 50 sec
Reputation Power: 11
Your not explaining yourself. The certain value?

If it is just one value.

Disable your combobox 2 and 3.

Then just select,

Code:
combobox1_click()
if combobox1.text = certainvalue then
 comboxbox2.enabled = true
 call loadinfotocombobox2
end if

combobox2_click()
if combobox2.text = certainvalue then
 comboxbox3.enabled = true
call loadinfotocombobox3
end if



This way it goes on from one, - two -third.


Hope that helps.

Reply With Quote
  #4  
Old June 28th, 2005, 09:03 AM
jacosta00021 jacosta00021 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 134 jacosta00021 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 39 m 31 sec
Reputation Power: 5
Quote:
Originally Posted by snipered
Your not explaining yourself. The certain value?

If it is just one value.

Disable your combobox 2 and 3.

Then just select,

Code:
combobox1_click()
if combobox1.text = certainvalue then
 comboxbox2.enabled = true
 call loadinfotocombobox2
end if

combobox2_click()
if combobox2.text = certainvalue then
 comboxbox3.enabled = true
call loadinfotocombobox3
end if



This way it goes on from one, - two -third.


Hope that helps.

wow i totally missed the question on that one...whoops

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Userform ComboBox Problems


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 5 hosted by Hostway
Stay green...Green IT