Troy
Well-known member
- Joined
- Feb 7, 2005
- Messages
- 153
- Programming Experience
- 10+
Let's say I have a database setup with 2 tables
The first is CONTACTS the second PACKAGE
Both tables have the field CONTACTID
This is because the first table contains primary customer information. Name, Address, etc.
The Second contain's products they have purchased. Since they might have repeat purchases they can add more entries. So this table also has CONTACTID to associate the record to the CONTACTS Table as well as PACKAGEID to give it it's own unique ID.
Is there a way to bind a BindingNavigator to a Table but limit it to only cycling through certain records ..
example setting up a Binding Navigator that allows me to display only PACKAGE Table information with the same CONTACTID as the first Table?
Man lol I almost lost myself trying to explain this I sure hope you can make heads or tails of what I'm trying to say. LOL
by the way here is an example of my binding statements which seem to work but are displaying the entire information not just those with the same CONTACTID.
The first is CONTACTS the second PACKAGE
Both tables have the field CONTACTID
This is because the first table contains primary customer information. Name, Address, etc.
The Second contain's products they have purchased. Since they might have repeat purchases they can add more entries. So this table also has CONTACTID to associate the record to the CONTACTS Table as well as PACKAGEID to give it it's own unique ID.
Is there a way to bind a BindingNavigator to a Table but limit it to only cycling through certain records ..
example setting up a Binding Navigator that allows me to display only PACKAGE Table information with the same CONTACTID as the first Table?
Man lol I almost lost myself trying to explain this I sure hope you can make heads or tails of what I'm trying to say. LOL
by the way here is an example of my binding statements which seem to work but are displaying the entire information not just those with the same CONTACTID.
VB.NET:
Private Sub Binds()
Me.txtContactContactID.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource1, "ContactID", True))
Me.txtLastName1.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource1, "LastName1", True))
Me.txtManufacturer.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "Manufacturer", True))
Me.txtDOM.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "DateManufacture", True))
Me.txtSerialNumber.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "SerialNumber", True))
Me.txtDEC.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "DateEscrow", True))
Me.txtModelNumber.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "ModelNumber", True))
Me.txtHUDNumber.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "HUDNumber", True))
Me.txtUnitSizeA.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "UnitSizeA", True))
Me.txtUnitSizeB.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "UnitSizeB", True))
Me.rdoNewUnit.DataBindings.Add(New System.Windows.Forms.Binding("Checked", Me.BindingSource2, "New", True))
Me.rdoUsedUnit.DataBindings.Add(New System.Windows.Forms.Binding("Checked", Me.BindingSource2, "Used", True))
Me.txtFlooring.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "FlooringCompany", True))
Me.txtSalesPerson.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "SalesPerson", True))
Me.txtMisc.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "Misc", True))
Me.txtComments.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "Comments", True))
Me.txtFlooringAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "FlooringAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtLoanAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "LoanAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtInvoiceAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "InvoiceAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtSalesTaxAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "SalesTaxAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtFreightAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "FreightAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtHCDAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "HCDAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtDealerPackAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "DealerPackAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtEscrowAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "EscrowAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtAccessoriesAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "AccessoriesAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtFoundationAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "FoundationAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtSepticAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "SepticAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtAirConditioningAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "AirConditioningAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtSchoolTaxAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "SchoolTaxAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtSalesCommissionAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "SalesCommissionAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtMiscAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "MiscAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtProfitAmount.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "ProfitAmount", True, System.Windows.Forms.DataSourceUpdateMode.OnValidation, Nothing, "C2"))
Me.txtPackageID.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "PackageID", True))
Me.txtPackageContactID.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.BindingSource2, "ContactID", True))
Me.txtServiceContactID.DataBindings.Add(New System.Windows.Forms.Binding("text", Me.BindingSource3, "ContactID", True))
Me.BindingNavigator1.BindingSource = Me.BindingSource2
Me.BindingNavigator2.BindingSource = Me.BindingSource3
Me.BindingNavigator3.BindingSource = Me.BindingSource1
End Sub
Private Sub frmNewRecord_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim CurrentRecord As Integer
BindingSource1.DataSource = dsContact
BindingSource1.DataMember = "Contact"
BindingSource2.DataSource = dsPackage
BindingSource2.DataMember = "Package"
Binds()
End Sub