code error

A

arthursdomain

can anyone tell me why im getting a debug error

Sub CboMoveTo_AfterUpdate()
Dim rs As DAO.Recordset

If Not IsNull(Me.cboMoveTo) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[Location] = " & """ & Me.cboMoveTo & """""
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
End Sub

its highlighting the
Dim rs AS DAO.Recordset

as says
Compile error
User-defined type not defined

Any ideas? I got this code from a previous post and from this website
http://allenbrowne.com/ser-38.html

try ing to create a combo box to search.
 
T

tina

open the VBA Editor window, then on the menu bar click Tools | References.
if there is no Microsoft DAO <version> Object Library checkmarked, then
scroll down the list until you find it, and checkmark the most recent
version (i'm guessing it'll be 3.6)

hth
 

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