Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DAO Object withRuntime

Status
Not open for further replies.

DougHomeOffice

Programmer
Oct 31, 2001
37
0
0
US
I use the code below in Access 2002 runtime, bu tI think
there is a DAO reference error. I am using Runtime but
the computer doesn't have office 2002, when I try to
install a new version of run time I get an active "x"
error. I tried going into an Excel module and open the
reference for DAO 3.6. I can just take out this code but
I am running into this problem all ove rwith Excel, Word,
etc.

-Doug

----------
Dim db As DAO.Database
Dim rs As DAO.Recordset

Dim strSQL As String

Set db = CurrentDb

strSQL = "SELECT Contacts.ContactID,
Contacts.LastName " & _
"FROM Contacts " & _
"WHERE [Contacts.LastName] LIKE '" &
Me.SearchForContact.Text & "*';"

Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)

If rs.RecordCount > 0 Then
rs.MoveFirst
Me.ContactList = rs!ContactID
End If

rs.Close
Set rs = Nothing
Set db = Nothing
.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top