Invalid reference

J

Johnny H

Dear list,


I have been given the task to migrate a VBA heavy A2k application on W2k to
Vista and Access 2007. I would like to keep the mdb format and the mdw file,
as the application uses 3 main databases and generates various user database
files. When I run the database, I get lots of errors. Some I can place
(FileSearch has gone), but with others I am a bit lost.

I get a lot of Invalid reference to property Form/Object. I now think that
can be traced back to the fact that there is no current record. Could that be
the case?

Even so, if I use the same query as has been given to the RecordSource of
the form/subform, I do get data.

I never get past the exit sub in the next snippet.

Me.RecordSource = strSelect

Dim rs As Recordset
Set rs = Me.RecordsetClone
If rs.EOF Then
Exit Sub 'nothing to display (No record)
End If

strSelect is valid when it is used as the SQL source for a query.

Please help.

Jan
 
P

Paolo

Hi Jan,
Check in the references (from the code view Tools References) if the
Microsoft DAO Object library is flagged and not missing. Missing because on
different operating system dll's could be placed in different places and if
is the case Access search the dll in the old place. So you just have to
browse to the new place.

HTH Paolo
 
J

Johnny H

Thanks for your help.
This is something I did, and all references are resolved.
That made it even more strange.
I get the invalid reference also with constructs as:
Me.SubForm.Form.RecordSource = str.

I am still flabbergasted.

Regards,

Jan
 

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