Compile Error after security applied

Fisher

Registered User.
Local time
Today, 23:53
Joined
Dec 17, 2003
Messages
28
I have an unbound list box that updates the data displayed on the form when a selection is made from the list.

Private Sub List13_AfterUpdate()
' Find the record that matches the control.
Dim R As Recordset
Set R = Me.RecordsetClone
R.FindFirst "[HospitalID] = & '" & Me![List13] & _
"'"
Me.Bookmark = R.Bookmark
Me![List13].Requery
End Sub

I am having problems with this no longer working once I import the database objects into a secured database. I am encountering an error "Compile Error: Method or data member not found" with reference to the list box in the "findfirst" statement.
I have tried this many times before and after the security and the results are consistent.
I was otherwise ready to go with this new database. Any insight would be appreciated as always.
Thanks.
 
Do you have a reference to DAO? This code used DAO.
 
I'm sorry. I'm not sure how to make such a reference. Is it perhaps a matter of checking one of the options in the references list or is there code that needs to be inserted?
 
i had a similar problem when it came to this when i used linked tables..not sure if thats the reason for the problem but i ended up scrapping the majority and redoing it. Hope you find what your looking for
best of luck
 
While viewing your code go to Tools>References and make sure Microsoft DAO 3.x Object Library is checked.
 
i was also told this..and to move the DAO above the Active X library.
 
That did it! Thanks so much to you both. When I initially checked the DAO option, the error still ocurred. When I changed the priority it worked. Thanks again RG and rborob, I appreciate it.
 
Glad to hear you got it working. You can also disambiguate your variables by specifying the library Dim R As DAO.Recordset
 

Users who are viewing this thread

Back
Top Bottom