combobox vb 2005

hello i have a form  products and i have inside the form  5 textbox and 1  combobox (PRODUCT ID is the combobox ) i want to   select a id from the combobox and the details of each number to apperar to all the textboxes.

pls can  u help me
LVL 1
demoniumzAsked:
Who is Participating?
 
Jorge PaulinoConnect With a Mentor IT Pro/DeveloperCommented:
demoniumz,
Ok then try later.
 
Thanks for the input Wayne :)
0
 
HooKooDooKuCommented:
Create a two dimensional string array to hold all your details...
Dim Details(1 to 5, 1 to ID_COUNT ) as string

Load the details into the Details String for each ID.

Load the Product ID into the combo box, basically for each Product ID do...
combobox.Add( the nth product ID or it's descrition )
...and make sure the combo box is unsorted

On the Click even of the combo box, update the text boxes...
On ComboBox_Clicked()
DIM ID as long
    ID = combobox.listindex
    textbox1.text = Details( 1, ID )
    textbox2.text = Details( 2, ID )
    textbox3.text = Details( 3, ID )
    textbox4.text = Details( 4, ID )
    textbox5.text = Details( 5, ID )
 
0
 
demoniumzAuthor Commented:
Create a two dimensional string array to hold all your details...
Dim Details(1 to 5, 1 to ID_COUNT ) as string

Load the details into the Details String for each ID.

Load the Product ID into the combo box, basically for each Product ID do...
combobox.Add( the nth product ID or it's descrition )
...and make sure the combo box is unsorted

 i dont understand these can u explain in more details pls
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
demoniumzAuthor Commented:
i forget to say that the form is in vb 2005 linked from ms access 2003 and using  binding navigator
0
 
demoniumzAuthor Commented:
can u help pls
0
 
HooKooDooKuCommented:
Oh, VB forms inside of access.

I don't have expericence doing that.  My experiance is in programming in VB6 stand-alone applications.

But still, the key should be updating the text fields on the combobox click event.  When the combo box has been clicked, you interigate which item in the combo box has been selected and update the text boxes accordingly.

The concept behind a 2D array was to load all the data you need into memory.  But given that you are linked to a database, you should have some way from within VB you can access the database values.
0
 
demoniumzAuthor Commented:
Anyone know solution for these problem VB 2005 LINKED FROM MS ACCESS OFFICE 2003 pls help
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
And the textbox's are also bind ?
0
 
demoniumzAuthor Commented:
Yes  IPAulino
0
 
demoniumzAuthor Commented:
are u know the solution to my problem
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
>> are u know the solution to my problem
Maybe :)
You have the combobox bind to the table and the textboxes also ? And have you done that using the wizards or using code ? If you use code please show some.
0
 
demoniumzAuthor Commented:
wizard.load the data from dataset to a form  have Product id as combobox thed other text box.
0
 
demoniumzAuthor Commented:
so ipaulino?
0
 
demoniumzAuthor Commented:
ipaulino ii apreciate your help here in ecperts exchange.so what sooiution you pprefer me
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
So you don't have the textboxes bound, right ?
By the way it's jpaulino :)
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Here's an example how you can do that.
https://filedb.experts-exchange.com/incoming/ee-stuff/7605-EE_Combobox.zip 
Basically you fill a dataset with all the necessary fields and then you filter that dataset and get the row (datarow) and use that for populate the textboxes.
Check if this helps!
0
 
demoniumzAuthor Commented:
i cant open it cause is  Higher version that vb 2005 can u  conevert it to 2005 pls  and uploading
0
 
demoniumzAuthor Commented:
I have upload a picture and all my form comment i open the form not all the aplication because is not regnnize the version  but is not work i make mistake can u corect me please Jpaulino:)
Public Class Norders
 
 
 
   
    Private Sub Norders_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'NicolaouDBDataSet.Orders' table. You can move, or remove it, as needed.
        Me.OrdersTableAdapter.Fill(Me.NicolaouDBDataSet.Orders)
        'TODO: This line of code loads data into the 'NicolaouDBDataSet.OrdersDetails' table. You can move, or remove it, as needed.
        Me.OrdersDetailsTableAdapter.Fill(Me.NicolaouDBDataSet.OrdersDetails)
        'TODO: This line of code loads data into the 'NicolaouDBDataSet.Products' table. You can move, or remove it, as needed.
        Me.ProductsTableAdapter.Fill(Me.NicolaouDBDataSet.Products)
        'TODO: This line of code loads data into the 'NicolaouDBDataSet.Suppliers' table. You can move, or remove it, as needed.
        Me.SuppliersTableAdapter.Fill(Me.NicolaouDBDataSet.Suppliers)
        'TODO: This line of code loads data into the 'NicolaouDBDataSet.Orders' table. You can move, or remove it, as needed.
        Me.OrdersTableAdapter.Fill(Me.NicolaouDBDataSet.Orders)
        'TODO: This line of code loads data into the 'NicolaouDBDataSet.Customers' table. You can move, or remove it, as needed.
 
        Me.SuppliersTableAdapter.Fill(Me.NicolaouDBDataSet.Suppliers)
 
        Me.SupplierIDComboBox.SelectedIndex = -1
        Me.SupplierIDComboBox.DropDownStyle = ComboBoxStyle.DropDownList
 
 
    End Sub
 
    Private Sub CustomersBindingNavigator_RefreshItems(ByVal sender As System.Object, ByVal e As System.EventArgs)
 
    End Sub
 
    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
 
    End Sub
 
    Private Sub OrdersBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OrdersBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.OrdersBindingSource.EndEdit()
        Me.OrdersTableAdapter.Update(Me.NicolaouDBDataSet.Orders)
 
    End Sub
 
    Private Sub CompanyNameTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CompanyNameTextBox.TextChanged
 
    End Sub
 
    Private Sub movenext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles movenext.Click
        OrdersBindingSource.MoveNext()
    End Sub
 
    Private Sub moveprevius_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles moveprevius.Click
        OrdersBindingSource.MovePrevious()
    End Sub
 
    Private Sub movelast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles movelast.Click
        OrdersBindingSource.MoveLast()
    End Sub
 
    Private Sub movefirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles movefirst.Click
        OrdersBindingSource.MoveFirst()
    End Sub
 
    Private Sub addrec_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addrec.Click
        OrdersBindingSource.AddNew()
    End Sub
 
    Private Sub delrec_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles delrec.Click
        OrdersBindingSource.RemoveCurrent()
    End Sub
 
    Private Sub OrdersBindingNavigator_RefreshItems(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OrdersBindingNavigator.RefreshItems
 
    End Sub
 
    Private Sub BackgroundWorker2_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker2.DoWork
 
    End Sub
 
 
 
 
 
    Private Sub SupplierIDComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SupplierIDComboBox.SelectedIndexChanged
        If Me.SupplierIDComboBox.SelectedIndex <> -1 Then
 
            Dim dr As DataRow = Me.NicolaouDBDataSet.Suppliers.Rows.Find(Me.SupplierIDComboBox.SelectedValue)
            If dr IsNot Nothing Then
                Me.ContactNameTextBox.Text = dr.Item(0).ToString
                Me.PhoneNumTextBox.Text = dr.Item(1).ToString
                Me.CompanyNameTextBox.Text = dr.Item(3).ToString
 
            End If
 
        End If
    End Sub
End Class

Open in new window

untitled.PNG
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
I will change to another version, but this is not workign  (the snippet from your code) ?
Do you have all the information you need in the dataset ?

Private Sub SupplierIDComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SupplierIDComboBox.SelectedIndexChanged
        If Me.SupplierIDComboBox.SelectedIndex <> -1 Then
 
            Dim dr As DataRow = Me.NicolaouDBDataSet.Suppliers.Rows.Find(Me.SupplierIDComboBox.SelectedValue)
            If dr IsNot Nothing Then
                Me.ContactNameTextBox.Text = dr.Item(0).ToString
                Me.PhoneNumTextBox.Text = dr.Item(1).ToString
                Me.CompanyNameTextBox.Text = dr.Item(3).ToString
 
            End If
 
        End If
    End Sub

Open in new window

0
 
demoniumzAuthor Commented:
what a re u mean  in dataset i cant not see the data in combobox. can u make me an example with  ms access database  to fill textboxes One combobox  two textboxes.I dont like to waist your time but is needed in order to continew
0
 
demoniumzAuthor Commented:
i am using vb 2005
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
0
 
demoniumzAuthor Commented:
not working pls make me a small example i appreciate using vb 2005
untitled2.PNG
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Check it again ... I think you have open the wrong application. Then name is EE_Combobox2005
0
 
demoniumzAuthor Commented:
open i  have the same thing but is not work i make it again tonight now i must go to work thnks man
0
 
Wayne Taylor (webtubbs)Commented:
FWIW, I was able to open the Solution fine by simply double-clicking the EE_Combobox2005.sln file.

Wayne
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.