473,287 Members | 1,581 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,287 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 1429
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: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.