dlookup in excel vba....

Joined
Sep 1, 2005
Messages
6
Reaction score
0
Assuming i have this mdb:
http://www.mytempdir.com/548579

and a sheet TEST where into A2
IN effect i would want to use all in vba for excel.

this is a part of code i have maked, boh?:

Sub test()
Dim cn As Object, rs As Object
Dim myReturn As Long
Const dbfullname As String = "c:\DATA\user.mdb"

Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" _
& dbfullname & ";" 'Create DB connection

Set rs = CreateObject("ADODB.Recordset")
With rs

''''
peraps here the code for matching?

''''
If Not .EOF Then Let myReturn = .fields(0)
.Close: Set rs = Nothing
End With

cn.Close: Set cn = Nothing

End Sub
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top