promotion image of download ymail app
Promoted database with drop down box, put on computer without ACCESS?

I am working on a simple program. I have a question about with a database. One part of my program allows the user to select a name from a drop down box, and then populates some information about that person into text boxes. For example, you select the name, and it populates the medicaid number.

Currently, I am populating that information with a simple If Statement (see example code at the end of this question). This works fine a small list of names, however, what if I need to add 100 names? Using if statements is possible, but gets messy.

This is what I need:

1.) To organize the data that populates iinto the drop box into a table, such as ACCESS database.

2). For this program to work on almost any computer, regardless if it has ACCESS on it.

I am a very new programmer, but would love to get this to work. Any and all ideas, references, links to simple tutorials, etc to help me understand would be greatly appreciated.

Public Class Form1

Private Sub ComboBoxName_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBoxName.SelectedIndexChanged

Dim firstName As String = txtBoxFirstName.Text

Dim lastName As String = txtBoxLastName.Text

Dim medicaidNumber As String = TextBoxMedicaidNumber.Text

If ComboBoxName.Text = "Jane Doe" Then

txtBoxFirstName.Text = "Jane"

txtBoxLastName.Text = "Doe"

TextBoxMedicaidNumber.Text = "111111111"

End If

If ComboBoxName.Text = "Jim Smith" Then

txtBoxFirstName.Text = "Jim"

txtBoxLastName.Text = "Smith"

TextBoxMedicaidNumber.Text = "3333333"

End If

End Sub

End Class

2 Answers

  • 7 years ago
    Favorite Answer

    DO you already have an Access database set up?

    you need to load the data from the Access Table into the combobox...

    If you have an Access Database with tables on it... I'll come back to you

    Source(s): VB6 Developer VB.Net (Training)
    • Commenter avatarLogin to reply the answers
  • 4 years ago

    you're able to desire to configure an odbc for be conscious to connect into the get right of entry to database. you could then insert your gadgets, with a study of the get right of entry to database to populate them. that's comparable to linking to an Excel spreadsheet

    • Commenter avatarLogin to reply the answers
Still have questions? Get your answers by asking now.