Urgent Help Please

vb6 Guam
  • 13 years ago

    Can anyone here can create a simple database appz that fills the column automatic using access database

    for example:

    if i choose a name from a dropdown list populated by table_user

    the Email, Phone No., will populate too, according to the columns of table_user

    help me please annyone just attach a file that does like this or send it to my Email

    niko66623@yahoo.com please

  • 13 years ago

    hope this will help...

     

    Option Explicit

    Dim db As Database

    Private Sub Combo1_Click()
        Dim tmpRs As Recordset
       
        Set tmpRs = db.OpenRecordset("select * from [table_user] where name='" & Combo1.Text & "'")
            If Not tmpRs.BOF Then
                Text1.Text = tmpRs!phone_no
                Text2.Text = tmpRs!email_ad
            End If
    End Sub







    Private Sub Form_Load()
        Set db = OpenDatabase(App.Path & "\sample.mdb")
        filldata
    End Sub


    Sub filldata()
        Dim tmpRs As Recordset
       
        Set tmpRs = db.OpenRecordset("select * from [table_user]")
            If Not tmpRs.BOF Then
                Combo1.Clear
                Do While Not tmpRs.EOF
                    Combo1.AddItem tmpRs!Name
                    tmpRs.MoveNext
                Loop
            End If
    End Sub












    ...if ive given u a wrong one then let me know. hope i can help you.

    ;where do you mean to load/populate the data?

     

    regards,

    jireh

  • 13 years ago
    Wink [;)]i send the sample program to your accountSmiley Face [:)]

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook