473,785 Members | 2,297 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Autopopulate text boxes after selecting a combo box entry

19 New Member
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 3624
SanjuMtr
47 New Member
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 New Member
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(ByVa l sender As System.Object, ByVal e As System.EventArg s) 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_PLANTab leAdapter1.Fill (Me.AutodbDataS et1.TEST_CASE_L INK, TEST_PLANComboB ox.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_PLANTab leAdapter.FillB ytestplan(Me.Au todbDataSet.TES T_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_Le ave" 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
6163
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 number in a text box and I'd like the information to pop up in text boxes on a form. Is it possible to bind text boxes to, say, the fields containing the CustName and CustAddress in a query? I want to use text boxes for appearance; I don't...
3
4279
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. Assistance would be greatly appreciated! I am trying to allow certain users to be able to preview a database's contents without being able to update which I've accomplished. I've created a "Preview" button and set the datagrid to READ ONLY. Now I want...
2
1626
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 data entry screen. The existing Access app writes to a table (tblTimesheetHours). In the data entry screen, the fields, like employee name, job, etc are bound to combo
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
11
2694
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 (obviously). The data is stored in a table named EMPLOYEE. I want to create a search option whereby managers can search for an employee by "BANNER_ID" by entering the number and pressing a command button named "Search". I want to create an...
9
5006
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 created three combo boxes that cascade down from Name to Project to Date and when this has been chosen I have four textbox fields I want to display based on this selection. I tried linking the last combo box comboDate to update these fields after...
2
4618
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 appears in the text box.
6
1893
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 table? NOTE: I have already tried this method with 50% success - it works but does not save to the table. control source of the text box - comboboxname.column(n) First Question? What is the best method to to autopopulate then save...
3
1960
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 this so please let me know how I would be able to perform this task. First, I have a table with field 1: units and field 2: has the corresponding battalions. I have a form that has the combo box for units and battalions. I want the battalion combo...
0
10356
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
10162
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...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
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
7509
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
6744
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
5396
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...
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
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.