Trap Default Access Error: Can't load image

  • Thread starter Thread starter Bradley C. Hammerstrom
  • Start date Start date
B

Bradley C. Hammerstrom

A2K,

My form has an image frame. The path and filename are stored in a table
(it's a path to a photo CD).

If the user tries to open the form when the CD is not loaded, I want the
error to be handled with a dialog, "Please insert CD" rather than the user
seeing the default error dialog from Access about how it can't find the
path--a bit technical for the user.

Q: In which event does the error occur? The image frame has no Events. How
can I override, or pre-empt, the standard default Access error dialog and
use my own in it's place? The error dialog pops-up prior to the form
opening.

Brad H.
 
Put code in the form Load event to check that the path exists, something
like:

if len(dir("PathToYourImage")) = 0 then
msgbox "Load the correct CD"
endif




--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Back
Top