473,765 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Assigning value to textbox when an item in combobox selected

2 New Member
Hello all

I am beginner to VB I populate all the professers name in one combobox ,If i select one professer name then thier designation will automatically display in textbox from database field designation

rs.Open "SELECT name,designatio n FROM profile", con
cboMenu.Clear

Do Until rs.EOF
cboMenu.AddItem rs("name")
cboMenu.ItemDat a(cboMenu.NewIn dex) = rs("designation ")

rs.MoveNext
Loop
rs.Close

this code dispaly all professers name,if i select on professer name her designation automaticaaly dispaly in textbox

In which event of combobox i write this

plz help
Sep 27 '06 #1
2 5817
CaptainD
135 New Member
Hello all

I am beginner to VB I populate all the professers name in one combobox ,If i select one professer name then thier designation will automatically display in textbox from database field designation

rs.Open "SELECT name,designatio n FROM profile", con
cboMenu.Clear

Do Until rs.EOF
cboMenu.AddItem rs("name")
cboMenu.ItemDat a(cboMenu.NewIn dex) = rs("designation ")

rs.MoveNext
Loop
rs.Close

this code dispaly all professers name,if i select on professer name her designation automaticaaly dispaly in textbox

In which event of combobox i write this

plz help
I would proably put it under the change event.

txtProfessorNam e.text = cboPrefessors.t ext
Sep 27 '06 #2
minu
2 New Member
It just display the profeesors name whom i select in the combobox,but what i want actually if i select one professors name then their corresponding designation will dispaly int he textbox from datbase

can u help me again
thnx
Sep 28 '06 #3

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

Similar topics

5
9000
by: Quan Nguyen | last post by:
How can I obtain the textbox (editing field) control of the combobox? I tried combobox.Controls to obtain the collection of controls that the combobox contains but it turned out to be empty. Thanks.
2
11705
by: martin | last post by:
Hi, I am looking for a method to check if an item (any item) is selected in a particular listbox before deleteing it from my database, however I keep getting errors, The code I have is lbSpecificProgram is a listbox.
2
33850
by: teddy.am | last post by:
Guys, I have a set of 6 radio buttons, infront of each one there's a textbox .... i need all textboxes disabled .... once one of the radio buttons is selected, the texbox infront of it will be anabled to type in ... any fast solution?
4
1992
by: cwoll | last post by:
I am runing this function to toggle buttens to display an "X" when they is selected, the butten is linked to a yes/no field. This function works good, the problem I am having is that when I make a new record the "X" from the last record I looked at are still there, but the bottens are not selected nether should they be. How do I clear every thing when creating a new record? Any help would be apprecated. Clarence Wollman Function...
3
5417
by: Patrick [MSFT] | last post by:
Let me preface this with the goal I'm trying to achieve is mimic a feature of another language (Dexterity used by Microsoft Dynamics) and so while a filling a drop down list is a workable solution I'd rather do it like Microsoft Dynamics does and use separate textbox and lookup button. What I have is, simply, is a C# winform, a textbox and a pushbutton. On the textbox, on the validating event of the textbox I check my customer table...
1
1563
by: rockdale | last post by:
Hi, all Is there a way to dynamically attach a regularexpressionvalidator to a textbox base on dropdownlist selected item? Let's say I have a dropdownlist list all contact type - phone, cell, email ...etc and a textbox that allow user to type in their contact info. When they choose email, I want attach the regularexpressionvalidator of email to the textbox, when the ddl selected phone, then I want attach phone regExp to the same...
4
27929
by: hhak | last post by:
Hi all, Im pretty new to C#, im trying to assign a combobox selected value to a int variable. int number; combobox has items added (1,2,3,4,...9) when i select a number from the combobox i want to assign this number to my integer variable. thanks in advance.
1
2236
by: =?Utf-8?B?RmxvcmlhbiBLb3dhbHNreQ==?= | last post by:
I need to paint a rectangle in above the textbox of a combobox. How can i do that. At present the rectangle is always in the background and the textbox is in the foreground!! Thanks
1
7240
by: libish | last post by:
can we add a value to a list item?? i got a list with some list members here can we add a value to that list item??? ie. suppose a list contains items like "item1" "item2" "item3" etc...
4
2278
by: chinni1 | last post by:
I Have 2 comboboxes in my form.The first combobox1 shoud be fill with the mainproduts which is cmng from database.By selecting The mainproduct the related sub product shoud dispaly in second combobox2. In form load written this code..... da = new SqlDataAdapter("select * from main_products", con); da.Fill(ds, "main"); da = new SqlDataAdapter("select * from sub_master", con); da.Fill(ds, "sub");
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10164
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
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
9835
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...
1
7379
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
5277
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
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.