Gina is on the right track; however, if it worked then now doesn't it sounds
as if your references have been changed or broken. First, when declaring a
DAO object in Access 2000 or newer, specify the library in the declaration
(i.e. Dim oDbs As DAO.Database). This is because Access uses the references
in the order that the checked items are listed in the references window (in
the code editor go to Tools|References). There are up and down arrows to
change the order, but if you specify the library being used, then the order
doesn't matter. The reason for the problem is that there are objects in both
ADO and DAO with the same name, but they behave differently.
If a reference has become broken, you need to fix it. The reference that is
broken may or may not be to the library that is causing you problems, but
fixing the broken reference will usually solve the problem anyway. You will
find a good explanation of this problem here:
http://members.iinet.net.au/~allenbrowne/ser-38.html
--
Wayne Morgan
MS Access MVP
"Alan4297" <(E-Mail Removed)> wrote in message
news:34A38BE2-BF9B-4E67-9ECF-(E-Mail Removed)...
> Six months ago, a VBA procedure worked fine. Now it doesn't work. The
> offending line is:
>
> Set oDbs = CurrentDb
>
> When I run the procedure, "CurrentDb" is highlighted and the message is:
>
> Function or interface marked as restricted, or the function uses an
> Automation type not supported in Visual Basic.
>
> What has happened?