The Command you specified is not available in an .mde, .accde, or .ade database

Sandpiper

Registered User.
Local time
Today, 08:59
Joined
Feb 21, 2006
Messages
55
HI

I have some code which runs through a recordset and prints out external documents listed in that recordset.
It is very old code that I have picked up from the original database (access 97)(we are now using Access 2010) and it seems to work fine in the accdb, but as soon as I create the accde, i get the error
"The command you specified is not available in an .mde, .accde, or .ade database"

my code is
set rs = Currentdb.openrecordset ("tblEthDocs", dbOpenDynaset, dbSeeChanges)
rs.movefirst
Do Until rs.EOF

Me.DocLocation1 = rs!DocLocation

Dim lngRetval as long
Dim loc as string
loc = "Z:\Tech\" & Me.DocLocation1
lngRetVal = OpenTIFFile(loc, True)
PauseApp 5
rs.MoveNext
Loop
Set rs = Nothing

Could anyone please tell me what i've done wrong, or what is causing the error in the accdb.

Thanks very much
 
How are you so sure that the error generates from this block of code?
 
This code sits behind a button, and the error only happens when this button is clicked, so i'm presuming this is where the error is.
Thanks
 
We can't know for sure. Try it out on the main accdb or mdb and click the Debug button to take you to the line of code causing this error.
 
What is the code in the user defined function, PauseApp?
 

Users who are viewing this thread

Back
Top Bottom