473,789 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Combo Box >> Help required ASAP?

2 New Member
hi..

I am creating a form where there are two combo Boxes (drop Down)
> Program_Combo_b ox
> Course_Code_Com bo

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 1452
shidec
26 New Member
U can add program in Program_Combo_B ox 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
jafarsibtain
2 New Member
U can add program in Program_Combo_B ox 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
1200
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" src=http://datafeed.XXXXXX.com/YYY.asp?area=XX&stories=10&url=www.ABC.com> </script>
2
1606
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 other combo box.In fact Application is selected based on Group,Division & Names.But in many cases there are Divisions which do not have any Names. I need to select Applications either on two conditions,one if Names are available, which...
7
3850
by: Malcolm Cook | last post by:
Hi, I've created and installed a custom UDF to populate my combobox, and have defined it per : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac10/html/acproRowSourceTypeFunctionParameters.asp I'm using ACC2002 in an ADP. However, I'm finding that he control variable (called "code" in the above documentation), is passed into my UDF with a value other than those listed
1
3369
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. As part of the setup, I specified a new dataset, which included the data & lookup tables. I also specified the relationships when required. I then added a combo box control to my form, following the instructions from
29
3848
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 that I can select a Location from one combo box, and a date from another combo box, and have a Subform populate with the correct data for each date/location selected. I'm not really sure how to go about this, but I've been reading maybe using a...
5
2216
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. The row source for combo2 is: SELECT DISTINCT tblComplaintCategory.fldComplaintCategory, tblComplaintCategory.fldComplaintCategoryID, tblComplaintSubjects.fldComplaintSubjectID
8
2815
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 "Bank Name" combo box, account number field and "account type" combo box to become required. Is this possible and if so how do I do it. TIA
7
22699
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 ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Dim Cmd As Odbc.OdbcCommand Dim Con As Odbc.OdbcConnection Dim Sql As String = Nothing
11
3099
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 allowed me to view only bikes of one make. i would like to know if there is way of making the parameter prompt a list/combo box contain the values within the motorcycles table so only motorcycle makes within the table can be queried (searched). ive...
0
9663
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10193
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9979
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9016
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7525
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6761
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.