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

    [email protected] 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.

“Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves” - Alan Kay