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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile Error

Status
Not open for further replies.

robmkimmons

Technical User
Jun 29, 2001
51
US
I just got a new computer and transfered my Access files over. On one of my forms i have the generic combo box which populates the form from the selection you make within the list. However, it produces a Compile Error when i select a row within the combo box stating:

"Can't find object or library"

Here is the code:

Private Sub cboSearch_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[CompanyID] = " & Str(Me![cboSearch])
Me.Bookmark = rs.Bookmark
End Sub

(The code is straight out of a wizard in Access)



~Rob

If we expect the unexpected, does that make the unexpected... well, expected?
 
First of all, you might wish to change
Code:
Set rs = Me.Recordset.Clone

...to

Code:
Set rs = Me.RecordsetClone
 
Replace this:
Dim rs As Object
By this:
Dim rs As DAO.Recordset
Check that Microsoft DAO 3.x Object Library is referenced.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top