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
Enter your message below
Sign in or Join us (it's free).