473,396 Members | 1,864 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,396 software developers and data experts.

Autopopulate text boxes after selecting a combo box entry

19
I have a form in which there is one combo box and three text boxes:

Combo Box:
-> Item A
-> Item B
-> Item C

TextBox1:
TextBox2:
TextBox3:

Once an Item is selected from the combo box, the text boxes are autopopulated with the respected fields which link to the items in the combo box.

Its getting the combo and the text boxes from a data base.

Can someone guide me as how to do that?

Write now I have a combo Box with all the items but I dont know how to link the text box fields to the items in the combo box.

So the text boxes 1, 2 and 3 are filled out on selecting an item from the combo box



Thank you
May 7 '07 #1
2 3603
I have a form in which there is one combo box and three text boxes:

Combo Box:
-> Item A
-> Item B
-> Item C

TextBox1:
TextBox2:
TextBox3:

Once an Item is selected from the combo box, the text boxes are autopopulated with the respected fields which link to the items in the combo box.

Its getting the combo and the text boxes from a data base.

Can someone guide me as how to do that?

Write now I have a combo Box with all the items but I dont know how to link the text box fields to the items in the combo box.

So the text boxes 1, 2 and 3 are filled out on selecting an item from the combo box



Thank you
Yes it can be achieved easily.
Now I have Just Give u the Hints.ok First Try Yourself. if not possible then i will
give u the Details Code.

1)First Populate the Combo in Form Load event.
2)Now write code(searching desire recor) in combo_change event.
a) select the fields that u want to display in textbox through recordset filter by combo.text
b) if recordset recordcount >0 i.e if u will find desire record then show it in the
corrosponding textbox.
May 8 '07 #2
jw01
19
Yes it can be achieved easily.
Now I have Just Give u the Hints.ok First Try Yourself. if not possible then i will
give u the Details Code.

1)First Populate the Combo in Form Load event.
2)Now write code(searching desire recor) in combo_change event.
a) select the fields that u want to display in textbox through recordset filter by combo.text
b) if recordset recordcount >0 i.e if u will find desire record then show it in the
corrosponding textbox.

Following is the code I have:

Public Class Form1

'Loads the names of the active cycles in the combobox
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'AutodbDataSet1.TEST_PLAN' table. You can move, or remove it, as needed.
' This is the query that is autopopulated
Me.TEST_PLANTableAdapter1.Fill(Me.AutodbDataSet1.T EST_CASE_LINK, TEST_PLANComboBox.Text)
'TODO: This line of code loads data into the 'AutodbDataSet.TEST_PLAN' table. You can move, or remove it, as needed.
' This is the query that loads the cycles
Me.TEST_PLANTableAdapter.FillBytestplan(Me.AutodbD ataSet.TEST_PLAN)

End Sub
End Class

So right now there are multiple enteries in the combo box but the text fields just point to the first one on the database. And dont change when a different entry is selected in the combo box.

Should it be something like "textchange in combo box" then autopopulate the fields with the appropriate items that link to the combo box.

I am new to VB so is it the "cboName_Leave" function or can you help me with the code please.

Thanks
May 8 '07 #3

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

Similar topics

1
by: Serious_Practitioner | last post by:
Hello, all - I want to get a customer name, address and so forth from a customer table using either a SELECT statement in a VBA procedure or in a query. The user should be able to put a customer...
3
by: Frustrated Developer via DotNetMonster.com | last post by:
I have posted a couple times on here already and found the user community to be very helpful. I took on a project before I realized how difficult a time I'm having working with a database....
2
by: Ausclad | last post by:
How Would you implement this? I have an existing Access application that needs to be converted to .net I am restricted to use the existing database design. One of the areas is a timesheet...
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....
11
by: martin DH | last post by:
I have an Access database of employees. Each employee has a unique identification number called "BANNER_ID". Each employee's last name and first name are in the database but are not unique...
9
by: Marianne160 | last post by:
Hi, I know there are various answers to this problem available on the web but none of them seem to work for me. I am using Access 2003 to make a form to look up data from a table. I have so far...
2
by: SHAWTY721 | last post by:
I have a form that contains two combo boxes that are related to each other. I need to find a way to populate my text box based on the criteria of the two combo boxes so the appropriate number...
6
by: GLEberts | last post by:
Hi, I would like to ask for some direction on what would be the best way to (1) Autopopulate a combo box to text boxes - used for a customer list (2) Then have the information saved in the...
3
by: hkim8392126 | last post by:
I've been searching and reading the forum, but with no success to find what I was looking for. I am trying to autopopulate a field in a form. I am not sure if I need to create a query or table to do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.