A
atomicpetrie
Guest
Hi everyone, i have only jsut started VBA, i have the following code, simply trying to get data to be displayed in a listbox.
Private Sub Form_Load()
Set db = OpenDatabase("C:\data.mdb")
Set rs = db.OpenRecordset("SELECT * FROM Customer")
With rs
Do
ListCust.AddItem !FName
.MoveNext
Loop Until .EOF
End With
End Sub
I have added module, and referenced the Microsoft DAO, but i get "Type Mismatch" on the line "Set rs = db.OpenRecordset("SELECT * FROM Customer")"
If anyone could get back to me asap, it would be much appreciated.
Thanks,
Tom
Private Sub Form_Load()
Set db = OpenDatabase("C:\data.mdb")
Set rs = db.OpenRecordset("SELECT * FROM Customer")
With rs
Do
ListCust.AddItem !FName
.MoveNext
Loop Until .EOF
End With
End Sub
I have added module, and referenced the Microsoft DAO, but i get "Type Mismatch" on the line "Set rs = db.OpenRecordset("SELECT * FROM Customer")"
If anyone could get back to me asap, it would be much appreciated.
Thanks,
Tom