DIR function in Access 2000

G

Guest

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
 
G

Guest

Thanks - fixed it as suggested


Allen Browne said:
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.

Reply to group, rather than allenbrowne at mvps dot org.

ridders said:
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
 

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