473,414 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Combo Box >> Help required ASAP?

hi..

I am creating a form where there are two combo Boxes (drop Down)
> Program_Combo_box
> Course_Code_Combo

in the Program Combo Box there are five items in the list >
1. BIT
2.BCA
3. MCA
4. MBA
5. MIT

now my problem is that i want to change the list contents of Course Code combo Box on the basis of selection from Program combo

say if i select BIT in Program combo Box it should immediately fill the course combo box list with these items
CST-101
CST-102
CST-103


now if i select MBA in Program combo Box , my course combo Box will show the course of MBA program , i.e. MM1, FM2. AC3 etc..

that is to say i want to fill the list of one combo box based on the selection of another combo box...

i am not using n e database ... just static values ..


please guide me how to do this...as i m new in VB..
i m using VB6 version...


please help me..asap

waiting for ur replies...

thank you...

jafar
May 15 '07 #1
2 1433
shidec
26
U can add program in Program_Combo_Box Click Event like this

Expand|Select|Wrap|Line Numbers
  1. Private Sub Program_Combo_Box_Click()
  2.  if Program_Combo_Box.ListIndex=0 then
  3.     Course_Combo_Box.Clear
  4.     Course_Combo_Box.AddItem("CST-001")
  5.     Course_Combo_Box.AddItem("CST-002")
  6.     Course_Combo_Box.AddItem("CST-003")
  7.  ElseIf Program_Combo_Box.ListIndex=1 then
  8.     Course_Combo_Box.Clear
  9.     Course_Combo_Box.AddItem("MM-121")
  10.     Course_Combo_Box.AddItem("MM-132")
  11.     Course_Combo_Box.AddItem("MM-143")
  12.  End If
  13. End Sub
  14.  
May 15 '07 #2
U can add program in Program_Combo_Box Click Event like this

Expand|Select|Wrap|Line Numbers
  1. Private Sub Program_Combo_Box_Click()
  2.  if Program_Combo_Box.ListIndex=0 then
  3.     Course_Combo_Box.Clear
  4.     Course_Combo_Box.AddItem("CST-001")
  5.     Course_Combo_Box.AddItem("CST-002")
  6.     Course_Combo_Box.AddItem("CST-003")
  7.  ElseIf Program_Combo_Box.ListIndex=1 then
  8.     Course_Combo_Box.Clear
  9.     Course_Combo_Box.AddItem("MM-121")
  10.     Course_Combo_Box.AddItem("MM-132")
  11.     Course_Combo_Box.AddItem("MM-143")
  12.  End If
  13. End Sub
  14.  

problem solved....thank you so much...
May 15 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Albert | last post by:
Hello all I am using a datafeed that provides me with a Javascript that spits out a bunch of hyperlinks to other locations. Her is what it looks like: <script language="javascript"...
2
by: Rob | last post by:
Hello, I am developing an A2K application.In the subform ,I have around 4 combo boxes for Group,Division,Name and Application.The selection criteria of each combo is narrowed based on the value of...
7
by: Malcolm Cook | last post by:
Hi, I've created and installed a custom UDF to populate my combobox, and have defined it per :...
1
by: James | last post by:
I am used to VB6 but need to develop something in .Net. I need to create several bound combo-boxes which will use lookup tables to get their values. I created a form using the dataform wizard....
29
by: gedwards | last post by:
First off, I am a complete newbie to Access. I've used it maybe a half dozen times, all my database knowledge is with Oracle. I'm building a database/form in Access 2003. I'm trying to get it so...
5
by: consonanza | last post by:
I am working on a report filter form. It has 2 combo boxes (cmboSelectSubject and cmboSelectCategory) to select criteria. Selecting an entry in combo 1 restricts the options available in combo 2....
8
by: umuckatie | last post by:
I have certain fields that I need to be required based on a previous answer in a combo box. Here is an example: If the user selects "deposit" from the combo box for "Reimburse By" then I need the...
7
by: nareshpulipati | last post by:
Hi all, I am new to VB .net. Iam trying to populate the database item into combo box. Database Type:SQL(ODBC) My code retuns no value in combo box Public Class Form1 Private Sub...
11
by: mezmerize | last post by:
Firstly a description of the situation to give you an insight. have a table of motorcycles (Registration no.,makes,models,colour,no.owners, etc. and i would like to be able to run a query that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.