Hello,
I have a two tables in my database (Customer, Transaction) which are related using the CustomerID. I have dragged and dropped the fields of Customer on my form using Visual Studio tools. When I select a different customer using the combo menu cboCustomer the fields of the Customer such as (name, last name, telephone) get updated. However, the fields related to the particular customer on the Transaction fields i.e. TransactionID, description etc are not.
Now, if I select the same customer TWICE, then the fields of Transaction are displayed.
What I'm I doing wrong?
Thanks!
2 1571
It would help to see the code.
Hi Rabbit. I have dragged and dropped the controls from the data sources. This is what I have in the form load event and selected index change methodd of the cboCustomerName: - Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
-
'TODO: This line of code loads data into the 'DbPBDataSet.Customer' table. You can move, or remove it, as needed.
-
Me.CustomerTableAdapter.Fill(Me.DbPBDataSet.Customer)
-
'TODO: This line of code loads data into the 'DbPBDataSet.Employee' table. You can move, or remove it, as needed.
-
Me.EmployeeTableAdapter.Fill(Me.DbPBDataSet.Employee)
-
-
-
grpDealerSessions.Enabled = False
-
grpTables.Enabled = False
-
lblSessionIDRes.Text = "No Running Session"
-
'TODO: This line of code loads data into the 'DbPBDataSet.Session' table. You can move, or remove it, as needed.
-
Me.SessionTableAdapter.Fill(Me.DbPBDataSet.Session)
-
-
-
'TODO: This line of code loads data into the 'DbPBDataSet.DealerSessions' table. You can move, or remove it, as needed.
-
Me.DealerSessionsTableAdapter.Fill(Me.DbPBDataSet.DealerSessions)
-
-
-
'TODO: This line of code loads data into the 'DbPBDataSet.Game' table. You can move, or remove it, as needed.
-
Me.GameTableAdapter.Fill(Me.DbPBDataSet.Game)
-
-
lblDateTime.Text = Now.ToString
-
'TODO: This line of code loads data into the 'DbPBDataSet.Transaction' table. You can move, or remove it, as needed.
-
' Me.TransactionTableAdapter.Fill(Me.DbPBDataSet.Transaction)
-
-
-
End Sub
-
-
----------------
-
-
Private Sub cboCustomerName_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboCustomerName.SelectedIndexChanged
-
Try
-
-
Dim iCountBuyins, iSumBuyins, iSumCashouts, iBiggestWin, iBiggestLoss As Integer
-
-
Thread.CurrentThread.CurrentCulture = New CultureInfo("el-GR", False)
-
Me.TransactionTableAdapter.FillByCustID(Me.DbPBDataSet.Transaction, CType(lblCustomerID.Text, Integer))
-
-
iSumBuyins = CType(TransactionTableAdapter.scalarTotalBuyin(lblCustomerID.Text), Integer)
-
lblSumBuyins.Text = iSumBuyins
-
-
-
iCountBuyins = CType(TransactionTableAdapter.scalarCountbuyins(lblCustomerID.Text), Integer)
-
lblSumBuyins.Text = iCountBuyins
-
-
iSumCashouts = CType(TransactionTableAdapter.scalarCashouts(lblCustomerID.Text), Integer)
-
-
iBiggestWin = CType(TransactionTableAdapter.scalarBiggestwin(lblCustomerID.Text), Integer)
-
iBiggestLoss = CType(TransactionTableAdapter.scalarBiggestloss(lblCustomerID.Text), Integer)
-
-
lblBiggestWinRes.Text = iBiggestWin.ToString("c")
-
lblBiggestLossRes.Text = iBiggestLoss.ToString("c")
-
-
-
' Displays i formatted as currency for the CurrentCulture.
-
' This will override any user settings and display the euro symbol.
-
-
lblTotalRes.Text = (iSumCashouts - iSumBuyins).ToString("c")
-
' FormatCurrency(iCashouts, , , TriState.True, )
-
Me.TransactionBindingSource.Position = Me.cboCustomerName.SelectedIndex
-
Catch ex As System.Exception
-
System.Windows.Forms.MessageBox.Show(ex.Message)
-
End Try
-
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics
by: martijn |
last post by:
H!
I have a big bsddb database created with python and that works fast.
I know that I can use the python_apache module to show the data results
online.
//--- python_apache module
<form...
|
by: popsovy |
last post by:
I am new to the discussion groups and to the .NET world, so this is probably a very basic question..
Is there any quick way in .NET to auto-generate data forms from typed datasets or SQL queries?...
|
by: Patrick.O.Ige |
last post by:
Whats the best way to pass Data with hidden fields in asp.net.
I want to capture a LOGON_USER(from an intranet using Windows
Authentication)and then send the data to a table in the Database.
Any...
|
by: John Dalberg |
last post by:
When I change the data source for a report say like from SQL to a stored
procedure or if the table fields have changed, all the bound fields on the
report vanish. It's time consuming to recreate...
|
by: bienwell |
last post by:
Hi all,
I have a data entry form in ASP.NET (Web development) which has some
fields (field1,..., fieldN) , button ADD THIS RECORD, and button CANCEL.
In button ADD THIS RECORD, I have VB.NET...
|
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...
|
by: tuxalot |
last post by:
Simple question I'm sure. I have a combobox listing various company names. Below the combobox there are address, city and state boxes. When a person selects a company, can I have the address city...
|
by: FKlusmann |
last post by:
I have inherited a big, messy table with duplicated data and empty fields consisting of Names (business, client, supplier, etc.), Addresses ( physical, mailing, shipping, billing), Orders ( Date,...
|
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...
|
by: BarbieJo |
last post by:
Using Access 2007
I want all the bound fields in my form to be locked until a command button is clicked. I have already tried locking the form through the OnLoad property using the following code:...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |