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

Home Posts Topics Members FAQ

populating text boxes...

in vb.net 2005, i would like to pull up a name from a database (customers) (i
can do this already), then after a name is selected from a combox box, to
populate the form's text boxes with with data about that customer. I.E.: if
john is selected from the combo, i would like to have his address, city, etc.
filled out in the text boxes. I do not want to populate a listbox or
datagrid.....I do these easy as pie in Access but i just can not do it in
vb..... can you please help....i am embarassed on how long i have spent on
this..and just can't get it....wish they had some wizards to create this like
they did in access.. thank you in advance........ . :>)
Jan 6 '06 #1
2 1796
Hi,

"Bill Brinkworth" <Bi************ @discussions.mi crosoft.com> wrote in
message news:E6******** *************** ***********@mic rosoft.com...
in vb.net 2005, i would like to pull up a name from a database (customers)
(i
can do this already), then after a name is selected from a combox box, to
populate the form's text boxes with with data about that customer. I.E.:
if
john is selected from the combo, i would like to have his address, city,
etc.
filled out in the text boxes. I do not want to populate a listbox or
datagrid.....I do these easy as pie in Access but i just can not do it in
vb..... can you please help....i am embarassed on how long i have spent on
this..and just can't get it....wish they had some wizards to create this
like
they did in access.. thank you in advance........ . :>)


1. open "Data Sources window" (menu-data)
2. create a new Data Source for your DB and Table (Customers)
3. inside "Data Sources window" you should now see your DataSet and
DataTable(Custo mers)
4. next to the Customers table, there should be a dropdown button, click on
it, if you don't see a ComboBox then choose customize and check the
ComboBox, if you do see a ComboBox then select it.
5. drag the Customers table on the Form, this should place a ComboBox on the
Form (and other binding stuff, you may delete the navigator), you can change
the field the ComboBox is showing, by changing DisplayMember ( ComboBox
properties ).
6. inside the "Data Sources window" you should also see all the fields under
the table, so drag any field you want onto the Form.

That should do it, but if you don't or can't go this way, then explain
(maybe with code) how you're already binding the TextBox.

HTH,
Greetings



Jan 6 '06 #2
I you don't like binding (and a lot of people don't) then the easiest way
I've found is to use SQL to find the customer information from the customer
name in the database then fill in the text boxes. This can be put into the
combobox.select edindexchange event. Alternately, you can read the customer
name and info into instance of a classs for each customer when you fill in
the combobox and add instances of this class to the comboboxfor each item.
If you include an override of "ToString" property in the class that returns
the customer name, that's what will appear in the combo box. You can then
use the combobox selecteditem with a directcast to your class and display the
customer info each time the user selects a different customer.
--
Dennis in Houston
"Bill Brinkworth" wrote:
in vb.net 2005, i would like to pull up a name from a database (customers) (i
can do this already), then after a name is selected from a combox box, to
populate the form's text boxes with with data about that customer. I.E.: if
john is selected from the combo, i would like to have his address, city, etc.
filled out in the text boxes. I do not want to populate a listbox or
datagrid.....I do these easy as pie in Access but i just can not do it in
vb..... can you please help....i am embarassed on how long i have spent on
this..and just can't get it....wish they had some wizards to create this like
they did in access.. thank you in advance........ . :>)

Jan 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4101
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
3
1580
by: luna | last post by:
theres no errors in my code - but it does nothing at all - its supposed to be populating text boxes!! any ideas ? (im am pretty new to all this) If Not Page.IsPostBack Then Dim search As String Dim strConn As String = "server=Gringotts;uid=sa;pwd=password;database=database"
1
2002
by: Meaney | last post by:
Hi, I have a form with 4 combo boxes. They are used for selecting SchoolName (lists 28 names), LocationName (lists 4 geographic locations), EquipmentName (lists 14 equipment types) and ObservationNumber (lists count number 1-3). All of the the combo boxes contain two columns. The first column is visible and displays the common name that the user can identify. The second column is the bound column and is hidden. This column (2) lists the...
1
2245
by: Stephene | last post by:
New to the world of web design/php/mysql and need help please. What I'm trying to do: I would like a web page with three drop down menus each populated by a query The first represents locations ie Room1, Room2 etc The second represents locations within the rooms i.e Rack1, Rack2 etc
1
1920
by: emmaruwa | last post by:
I have a form with two text boxes (in its details section) that pull data from two fields in my database table. This same form also has a button beside the text boxes which is supposed to open another form and populate that form with a record from the table using the data in the previous two text boxes as record selection criteria. However, it seems Access 2003 only uses one of the 2 text box data as criteria, i.e., no provision for using two...
0
1706
by: koonda | last post by:
Hi all, I have a Project due after one week. It is a web service project. I have a Web Form which communicates to the web service and this web service communicates to the database. I have all my SQL statements in the Data Acess Layer to create more secure web service application. The Web service class is also in the Data Access Layer. I need to populates the 4 Dropdown list boxes on the web form from one table. I have Customer table which...
6
8278
by: zuchowra | last post by:
Hi everyone. I need help. I have a combo box in my form that i want to populate multiple text boxes after you select your selection in the combo box. Here is my set up. The Fields that need to be populated are lsited below but must be recorded to a new table. Gets info from Course occurance Table. Combo Box - Gets Information from Course Occurance Table. This table has all information regarding course information. Course ID: Course...
2
3268
by: Dave | last post by:
I have 3 tables of information feeding into 4 combo boxes on my main form (DR Form). I have as many list boxes (acting as text boxes) as there are fields in each one of the 3 tables. Once selecting from the combo box, I have all the combo boxes, using afterupdate, populating their respective list boxes. These text boxes are directly correlated to the combo box selection using SQL. Here is an example from the afterupdate event in the...
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.
0
9647
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
10161
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
10098
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
9958
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
6743
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
5390
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...
1
4058
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
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
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.