Dir should work in A2000.
It would be worth checking your references are okay.
Press Ctrl+G to open the Immediate window.
Choose References on the Tools menu.
Look for any marked "MISSING".
More info on what references you need in each version of Access:
http://allenbrowne.com/ser-38.html
Another possibility is that you are in sandbox mode:
http://support.microsoft.com/kb/239482/en-us
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"ridders" <(E-Mail Removed)> wrote in message
news:2A828AA4-8CD2-4E3D-BEF3-(E-Mail Removed)...
>I have a database created in access 2003 (using the default Access 2000
> format).
> This has an autoexec macro including a query which uses a DIR function to
> test if a number of files exist. It works fine.
>
> The query is:
> UPDATE DefaultImage, PupilData INNER JOIN ImagePath ON PupilData.PupilID =
> ImagePath.PupilID SET ImagePath.ImageCheck = IIf(PupilData![Photo
> Available]=Yes Or Dir(ImagePath!PhotoPath)<>"",Yes,No),
> ImagePath.ImagePath =
> IIf(ImagePath!ImageCheck=Yes,ImagePath!PhotoPath,DefaultImage!DefaultImage);
>
> However when I tried to run the database in Access 2000 it won't run.
> Error message is User-defined type not defined.
> The error disappears if I amend the query to delete DIR but I need the
> functionality.
>
> Is DIR available in Access 2000? If so, do I need to tick any references
> in
> VBA editor e.g. DAO? If not, any suggestions how to rewrite this query?
>
> Thanks in advance for any help