Test if file found

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Folks,
I have images on a form that I load based on a field in a table. Works
well. However, sometimes I have a path/file name in the table when the file
does not exist. When this happens I continue to see the previous image. The
question is: can anyone suggest a way to test for the existence of the file
and if not found, indicate it so I can make the program do something else?

Your help is appreciated.
 
Thanks Mr B. I have tried and tried to make this work to no avail. I see
the response (0 for no file) in the immediate window but it doesn't work from
the form. I may be referring to the image incorrectly. I did:

IF FlsFile("[imagename]") = 0 then

etc, etc.

The imagename is coming from a field in the table and it is valid but some
of them are just missing. I see the good ones and a blank screen for the
others. I tried:

If IsNull(Me.ImageCtrl) Then
blah, blah, blah

Still doesn't work.

Do you have any other ideas? Also, how would I move to the next record. I
tried SendKeys={ENTER} (enter behavior goes to next record), but it didn't
work.

Thanks in advance.
 
Bonnie,

You need to provide the complete path to the file that you are testing for.

--
HTH

Mr B


Bonnie said:
Thanks Mr B. I have tried and tried to make this work to no avail. I see
the response (0 for no file) in the immediate window but it doesn't work from
the form. I may be referring to the image incorrectly. I did:

IF FlsFile("[imagename]") = 0 then

etc, etc.

The imagename is coming from a field in the table and it is valid but some
of them are just missing. I see the good ones and a blank screen for the
others. I tried:

If IsNull(Me.ImageCtrl) Then
blah, blah, blah

Still doesn't work.

Do you have any other ideas? Also, how would I move to the next record. I
tried SendKeys={ENTER} (enter behavior goes to next record), but it didn't
work.

Thanks in advance.


Mr B said:
 
The memory variable contained the complete path and is working elsewhere to
view the files. But I have found another way to test for the file. I am
using FileLen() and suppressing errors. Works great now and I'm flagging and
by-passing the records missing images.

Thanks for your help though.

Mr B said:
Bonnie,

You need to provide the complete path to the file that you are testing for.

--
HTH

Mr B


Bonnie said:
Thanks Mr B. I have tried and tried to make this work to no avail. I see
the response (0 for no file) in the immediate window but it doesn't work from
the form. I may be referring to the image incorrectly. I did:

IF FlsFile("[imagename]") = 0 then

etc, etc.

The imagename is coming from a field in the table and it is valid but some
of them are just missing. I see the good ones and a blank screen for the
others. I tried:

If IsNull(Me.ImageCtrl) Then
blah, blah, blah

Still doesn't work.

Do you have any other ideas? Also, how would I move to the next record. I
tried SendKeys={ENTER} (enter behavior goes to next record), but it didn't
work.

Thanks in advance.


Mr B said:
Bonnie,

See if this will help you:
http://www.mvps.org/access/modules/mdl0009.htm

--
HTH

Mr B


:

Hi Folks,
I have images on a form that I load based on a field in a table. Works
well. However, sometimes I have a path/file name in the table when the file
does not exist. When this happens I continue to see the previous image. The
question is: can anyone suggest a way to test for the existence of the file
and if not found, indicate it so I can make the program do something else?

Your help is appreciated.
 

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

Back
Top