DB/Reporting :: Combobox - Get Data Based On The Selection

Jan 31, 2009

I have VS2005, Microsoft Access 2003

ComboA is binded to the Customerstbl and displays the CustomerNames. ComboB is Binded to the CustomerContactstbl for the selected customer above and displays all Contacts for that customer is a second cbobox.

I am having a hell of a time with this, When I select a customers name in ComboA, I want ComboB to automattically query the contacts in ComboB based on ComboA's selection. where do I create the query for getting the contacts for that customer?

In the Customer or Contacts tbl?

Is this something that would be better hard coding or is VS2005 that much improved that its ok to use these binding features?

View 1 Replies


ADVERTISEMENT

DB/Reporting :: Show Values From Data-set To Text Box Based On Selection From Combobox List

Mar 18, 2008

How Do I show the values from the dataset to the text box based on the selection from the combobox list i already populated the combobox my code is. [code]

View 3 Replies

DB/Reporting :: Dependent ComboBox Based On Selection In Major Category

Apr 3, 2009

I'm running into a little problem making one combo box dependent on the selection of another combo box. I'm using a access back-end to this project. I have two tables: MajorCategoryTbl and MinorCategoryTbl , MajorCategoryTbl has PK and description field, MinorCategoryTbl has a PK, MajorID (foreign key), and description field. I have two combo boxes on my form, one that displays the Major description, and one that displays the MinorCategoryTbl description, but the stored value is the PK for both. I want the selection of the minor category combobox to depend on what was selected in the major category combobox.

View 2 Replies

VS 2010 Populate Textbox With Excel Data Based On Combobox Selection?

Nov 29, 2011

Visual Basic 2010 Express: I have a form with a combobox that is populated with the names of locations from a datagrid which in turn was imported at run-time (Form_Load) from an Excel database. The Excel database (and the datagrid) also stores the information for addresses and phone numbers for their respective locations.

What I would like to do is have the phone number and address text boxes automatically be updated with the proper corresponding data when the user selects a location from the combobox. Whether the text boxes are updated from the datagrid or Excel database is not a concern; I'm mainly looking for whichever way is simpler.

View 3 Replies

Forms :: Get Hidden Value / Tax From Combobox Based On Selection

Feb 17, 2010

I have a combobox populated from the DB with:

-ID
-State
-Tax

State is the only value that is shown.I'm trying to get the hidden value, Tax, from the combobox based on the selection but can't figure it out.

View 5 Replies

How To Generate Unique ID Based On Combobox Selection

Apr 9, 2009

how to generate unique ID based on combobox selection?

View 5 Replies

Populate Combox Based Upon Selection Of Another Combobox?

May 17, 2012

I'm new to programming and I'm using vb.net 2010 and I'm stuck with this problem. So here are the details, I have 2 tables in my database, a product table and a category table. In my product table I have product no, product description and category no. In the category table i have category no and category desciption. So this is where Ive been stuck for the entire day, I want my combox(product) to populate based on what is in the combobox(category). For example I have "Chair" in my combobox(category), then what would appear in the combobox(product) would be "sofas", "dining chair" etc.'the part below is where the program will read the category description from my database

Sub fillcomboDesc()
Dim fillcatDesc As MySqlCommand = New MySqlCommand("Select catDesc from category;", connection)

[code]....

View 2 Replies

Populating Textboxes Based On Combobox Selection?

Jan 8, 2010

I'm trying to populate textboxes on one form based on a selection on a combobox on another form. All data will be pulling from the same SQL table. I've got the combox to work fine to show the correct data in one of the textboxes by using the lines:

Dim connectionString As String = "Data Source=F03D3S-DEV01; Initial Catalog=dos_track;" _
& "Integrated Security=True"

[Code].....

,but not sure how to get the other textboxes to fill with the correct data (from the same SQL table row) associated with the combobox selection. I've spent SO MUCH time on this trying to figure it out, but am getting nowhere fast...

View 4 Replies

Grabbing Rows From A Dataset Based On Combobox Selection?

Jun 3, 2010

I am creating a program that will allow me to manage server EXE's for which I have the method to do so already completed. The problem comes when I want my front end to be able to use a database of different server configs stored in a dataset.

My Database has 4 columns (ServerID | ServerName | ServerPath | ServerMod)

I wish to be able to select the ServerName in a combo box (already done via Datasource/DataMember) and then load the ServerPATH and ServerMOD for that row into two variables.

View 1 Replies

Populate Textbox Based On ComboBox Selection Not Using Databinding

Apr 27, 2010

I have a form, frm1 w/a combobox, cboLocations, which is being populated using a sql string. There is also a frm2 w/a series of textboxes and other comboboxes. I want it so that once a selection is made from cboLocations, the textboxes and comboboxes on frm 2 are populated with the corresponding data. Here is what I have so far:

frm1:
Public Class frmLocations
Dim conn As New SqlConnection("Data Source=f03d3s-dev01; Initial Catalog=dos_track;User Id=vbuser; Password=tran3;")
Dim depot_refnbr As Integer
Private Sub frmLocation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
conn.Open()
[Code] .....

What's happening right now is that I make a selection from cboLocations on frm1 and click on the OK button, frm2 loads, but none of the textboxes are populating and one of the comboboxes, cboDepot, shows the different data when you click on the down arrow, but it's not displaying anything it its text field when frm2 loads.

View 14 Replies

Populating Textboxes Based On A Combobox Selection Using A Datareader?

Mar 26, 2012

I have a database with table "Customer" that will be the datasource for my form controls. My form has a combobox and various textboxes that need to change based on the selectedvalue in the combobox, cboCustNo. Firstly, I'm try to get the combobox to populate with the customer names on the table but have the value member of the combobox set to their customer numbers (just for ease of indexing). Based on the user's selection I'm trying to have various textboxes show the corresponding data (Address, City, Balance, etc.). The code I have so far is below:

Dim cnnDB As New Data.OleDb.OleDbConnection
Dim cmdSelect As New OleDb.OleDbCommand
Dim rdCustomer As OleDb.OleDbDataReader
Dim CustTable As New DataTable

[Code]....

View 3 Replies

Forms :: Populate Textboxes Based On Combobox Selection NOT Using Databinding?

Apr 27, 2010

how to go about this? I have a form, frm1 w/a combobox, cboLocations, which is being populated using a sql string. There is also a frm2 w/a series of textboxes and other comboboxes. I want it so that once a selection is made from cboLocations, the textboxes and comboboxes on frm 2 are populated with the corresponding data. Here is what I have so far:

frm1:
Public Class frmLocations
Dim conn As New SqlConnection("Data Source=f03d3s-dev01; Initial Catalog=dos_track;User Id=vbuser; Password=tran3;")
Dim depot_refnbr As Integer

[Code]...

What's happening right now is that I make a selection from cboLocations on frm1 and click on the OK button, frm2 loads, but none of the textboxes are populating and one of the comboboxes, cboDepot, shows the different data when you click on the down arrow, but it's not displaying anything it its text field when frm2 loads.

View 4 Replies

.net - Clean Way To Display/hide A Bunch Of Buttons Based On A ComboBox Selection?

Apr 14, 2010

I'm writing a standalone application in VB.NET using Visual Studio 2005. I want to display/hide a bunch of Buttons based on the selected value of a ComboBox. Each selection would have a different set of Buttons to display, and I'd like to have them arranged in a nice grid.

Driving a TabControl with the ComboBox value would be the kind of behavior I want, but I don't want it to look like a TabControl to the user because it might be confusing.Is there a way to do this?

Basically, I'd like Selection1 of the ComboBox to show Buttons 1-4, Selection2 to show Buttons 5-11, Selection3 to show (maybe) Buttons 1, 3, 5, 6, and 8, etc., have them arranged nicely, and have the GUI show only the ComboBox and the buttons.

View 3 Replies

VS 2008 - Populate Master / Detail Datagridviews Based On A Combobox Selection?

Apr 14, 2009

I have a product table with ProductId,ProductName,ProductCode as fields. I've populated a combobox with productnames. Next I have two other tables called Result_Header and Result_Detail. The Result_Header table has ProductId as a foreign key and BatchNo,TestDate etc. The Result_Detail table has ResultId as a foreign key which is the ResultHeaders Primary Key and other fields such as Result,SpecHi etc. What I need is when I select a Product from my combobox my two datagridviews must be populated via the Result_header and Result_detail tables respectively.

View 20 Replies

DB/Reporting :: SQL DataSet Selection Of Data

Mar 12, 2009

I'm writing an application to mimic a cash machine, I have a Form1 on which the user enters their PIN and chooses their card no. from a drop down box.The accountID is passed to Form2 and I know this is successfully seen by displaying it in a simple message box.A data adapter and dataset are used for this to the cards table.However, what I then require is within Form2 to retrieve the balance from that accountID in table Accounts, another data adapter and dataset have been created for this under Form2.I'm trying to get the balance into another variable, and I have written this as follows: [code]I would expect the result of this to be e.g. 100.00 but instead I am getting a response of "There is no row at position 0".

View 1 Replies

Selecting Data In One DataGridView Based On Selection In Another?

Oct 5, 2009

NB: I'm using Visual Basic.NET?My form has 2 DataGridView controls. One of these is bound to a DataSet, the other isn't visible - at least not until the user selects a uniqueidentifier cell in the 1st grid.When the user makes this selection, the 2nd grid will become visible and display the row from another with the same id as the one selected in the 1st grid.So, basically, I want to dynamically display data in one grid based on user selection in another grid.My code looks like this so far...

Private Sub RulesGrid_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles RulesGrid.CellClick
Try
FlagsGrid.Visible = True

[code]....

View 2 Replies

Place Data In DataGridView From ComboBox Selection?

Aug 15, 2010

I have on my form a combobox, a datetimepicker, a button and a unbound datagridview. The datagrigview is fild with data like a yearcalender.So i have in first column all dates of januari, then a blanc column, then the dates of februari, then a blanc column and so on...This is wat the user will do :

select his name from the combobox, select a date from the datetimepicker and press the button.What i would like to happen then is this : Find in the datagridview the same date as the selected one and then place the selected name in the blanc cell next to that date.

View 17 Replies

Retrieve Data From DB Depending On Combobox Selection?

Jul 18, 2012

i have a DB table and a form the following fields , combobox and textboxes, what i need is how to write a query to retrieve data from the table when the user select some record from combobox

View 7 Replies

DB/Reporting :: Refreshing A Data Adapter / Combobox?

Mar 22, 2009

I'm currently coding an ATM system in VB, and when a user picks a card to 'log on' with, they have 3 attempts to log on before the card is confiscated. The card numbers are in a combobox (which are retreived from an SQL database using the DataAdapter), and each card has a boolean 'confiscated' field in the database.

[Code]...

View 1 Replies

Filter Other Comboboxes Based In First Combobox Whish Is Having Same Data As All?

Jun 3, 2012

my question is how to filter other comboboxes based in first combobox whish is having same data as all.i am using visual basic 2010 and a ms access database which is connected with code.a vb form have five comboboxes and all comboboxes are field with same data with this code:

Private Sub loadsubject()
Dim OleDBC As New OleDbCommand
Dim OleDBDR As OleDbDataReader

[code].....

View 1 Replies

Update Source Combobox To Printer Combobox Selection?

Mar 27, 2011

Is there a way to update source combobox to printer combobox selection?So going from printer1 to printer2 the source will update according to what that printer has to offer.

View 8 Replies

Data Grid Selection Load Form - Call A Stored Procedure With The Value Of The Selection

Feb 27, 2009

I am trying have a data grid selection populate a form. I am new to this.Basically I have a connection persistance object and I would like to call that and call a stored procedure with the value of the selection. The datagrid is bound to an object.

[Code]...

View 1 Replies

Combobox - When Select A Value From The Combobox The Selection Won't Validate?

Feb 22, 2012

I'm having a problem with combo boxes. I usually use Java and it's been awhile since I used VB but I never remember having this much difficulty.My application is using an SDF file. From Data Sources, I drag the details on one of my Tables to my Form to get all of the fields. Three of them are comboboxes. Each of the three is an INT64 and each corresponds to a primary key in a different table. I click the tasks button on a combobox and for data source I select the appropriate table that has the data to go with the combobox, for display member I select the field that I want users to see, and for value member I select the primary key. Then I run a quick test and start the app, open the form, and add a new record. When I select a value from the combobox the selection won't validate because it doesn't think it's an INT64 like it should be. It seems to be using the display member as the actual value instead because if I change display member to the primary everything works great.

View 11 Replies

Fill A ComboBox On The Selection Change From Second ComboBox?

Jan 15, 2012

I have two comboBoxes, one is CountryCombo and second is StateCombo.What I want is the that when i the clicks country combo and select a one country then the States of that the country should get populated in the State Combo.I have tried things many many many but nothing working. Below is my code of how my CountryCombo is getting filled.

query="select CountryName from CountryMaster"
if dr.hasRows()
{[code]......

View 3 Replies

Way To Create Empty Data Table / Update Its Contents Based On Columns Not Add Data Based On Addition Of New Rows

Apr 6, 2011

I am creating a project in VB.NET in which one of the reports require that the name of employees should be displayed as column names and whatever work they have done for a stated period should appear in rows below that particular column.Now as it is clear, the columns will have to be added at runtime. Am using an ODBC Data source to populate the grid. Also since a loop will have to be done to find out the work done by employees individually, so the number of rows under one column might be less or more than the rows in the next column.Is there a way to create an empty data table and then update its contents based on columns and not add data based on addition of new rows.

View 1 Replies

Calculating Based On The Selection?

Mar 4, 2012

I have a listbox with two values, Current account and Deposit account.The current account has an interest rate of 7% and the deposit account 3%.I have 4 other textboxes. The boxes on the right is where the user inputs and the left side holds the value.

Account Type [ ] Listbox >>[Current account]
Deposit account
Investment Amount [ ] [ ]
Interest over a year [ ]

What I want for the Investment Amount is that if the user selects Current account, the amount invested will be automatically calculated with the 7% interest and the same for the deposit, calculation with 3% interest.And the Interest over a year textbox to show how much the interest will be over that year at the rate (whether its 7 or 3%)

View 7 Replies

Dynamicaly Refresh Databound Combobox Items Based On Selected_index_changed Event Of Another Combobox?

Jan 27, 2010

I am using VB.NET together with ADO.NET to create a program. I have set my TableAdapters as needed and bound the correct tables-columns to my comboboxes.My problem though is this:My combobox2 item is bound to a datatable. The table adapter's Fill method (the select command basicaly) includes a public variable in the where clause to fetch the correct results. I ll put some code here to clarify it a bit more.Public Class Frm_inv

[Code]...

View 5 Replies

Have One Combo Box Populate Another Based On Selection?

Jun 22, 2010

I am currently stuck in one part of my application. I have two combo boxes that i am having the users select from. The first combo box is simply bound to a datatable. that is working properly. The second one i need to populate off another datatable after sorting out what the first one is requesting. Basically it's choosing a line number on the first box and then selecting the machine associated with that line number.[code]...

View 4 Replies

How To Generate ID Based On Comboboxes Selection

Jun 18, 2012

i am creating a programme for my institute which helps in their administrative process. i am using visual studio(basic) 2010. which is connected with ms access database (abcdata.accdb) the database is having table called session with columns sessionID,sessioncode,sessionname.

* sessionID data = 1,2,3,4
* sessioncode data = 13,14,15,16
* sessionname data = 2013,2014,2015,2016

[Code].....

other then this u can see i want this because i am trying to create a database which must save the students data year wise, so that whenever we need to know a detail any students then we can find with query.

View 2 Replies

Replace One Control With Another Based On Selection?

Feb 12, 2012

On my form I have two radio buttons. One for CDs and one for books. If I select CDs I have a group box that changes visible = true and I have txt boxes there I want to input. If I select books I want the groupbox to remain visible = false and in its place a text box to appear. How would I do this? I know I can just overlap the controls but that looks hideous in designer.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved