Pictures - please explain code !? (Northwind)

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

Guest

Hi
Trying very hard to get my pictures to appear in records on a form.
Got some help from here, but got stuck, looked up 'Northwind' - the supplied
sample database, copied some of code , but please explain following :-
IsRelative = (InStr(1,fName":"=0) And (InStr(1,fName,"\\")=0)
If I change this to IsRelative = True my pictures do appear, but I do not
understand what this code means/does ?!?!?!?! Help would be lovely !!!
Al
 
Assuming that should actually be IsRelative = (InStr(1,fName,":")=0) And
(InStr(1,fName,"\\")=0), it'll be true if the characters : and \\ do not
appear in fName.

The InStr function compares two strings. If the second string exists
anywhere in the first string, it returns the position of the first
occurrance. If it doesn't exists anywhere, it returns 0. Therefore, the
first part (InStr(1, fName, ":")=0) will be true if there's no colon
anywhere in fName. Similarly, (InStr(1,fName,"\\")=0) will be true if
there's no \\.

If there's no :, then fName can't be referring to a mapped drive, while if
there's no \\, then it can't be referring to a UNC.
 
The line will set isRelative to true if there is no ":" in the string fName
and there is no "\\" in fName. In other words, isRelative is true if the
filename is either a simple filename (no path at all) or if the path starts
from the current directory. This is called a relative filename. If the
path starts from a drive letter (C:) or from a machine name (\\) then
isRelative is false.

I would guess that you are using a filename of a file or folder and file in
the root directory without also specifying the drive letter.
 
Thank you both so much, understood and working, however, one more question ?
I have pictures from my digital camera appearing in the Access Form. I am at
an early stage, and first test photos are 241Kb. This is possibly not the
lowest resolution I can use, but it does seem to cause Access to take a time
to load, i.e. the calculating bars appear each time one scrolsl to the next
record - Is my code too slow, photos need to be reduced, any way to make it
more efficient ?
Thanks very much for the help, getting on leaps and bounds !!!
Al
 
Hi Al,

Do the pictures in the sample Northwind database load quickly for you? If
not, you may have old hardware that could stand to be updated, or perhaps
your hard drive needs to be defragged. Your temporary files folder might also
be jammed with stuff that should be cleaned out.

Note also that the Northwind employees photos are 41 KB bitmap images. These
are about 17% of the size of your photos.

Tom
_________________________________________

:

Thank you both so much, understood and working, however, one more question ?
I have pictures from my digital camera appearing in the Access Form. I am at
an early stage, and first test photos are 241Kb. This is possibly not the
lowest resolution I can use, but it does seem to cause Access to take a time
to load, i.e. the calculating bars appear each time one scrolsl to the next
record - Is my code too slow, photos need to be reduced, any way to make it
more efficient ?
Thanks very much for the help, getting on leaps and bounds !!!

Al
 
Thank you so much for your reply. I have now retaken some test pics which now
take up between 15 & 35Kb each - smaller than 'Northwind'
Yes 'Northwind' scroll back and forwards quickly. I have almost copied their
coding, but when I use the wheel on my mouse to scroll through records on the
form, for an instant each change there is a box on screen
'importing................ with a 'cancel' button on it, it only just
appearas before vanishing, but the 'flicker' is annoying !! I would like to
get rid of this, any ideas ?!
Thanks again

Al
 
Hi Al,

I see the same flicker when I scroll through records quickly. I guess my
only suggestions would be to 1.) disable the mouse wheel (see Stephen Leban's
web site for a method of doing this: www.lebans.com and search for mouse
wheel) or 2.)limit the number of records that are available. This second
method is especially useful for multi-user databases, where the data is in a
shared folder on the server. It involves using an unbound lookup form to find
a set of records, with some info. from each record displayed in a subform.
Then one double-clicks on a given record in the subform to open up the form
that includes the picture with just one record. This second method involves
more work to set up, and is not really needed for single-user databases where
everything is stored on the same hard drive. However, it does help reduce
unnecessary network traffic in a multi-user database.

Tom
http://www.access.qbuilt.com/html/expert_contributors.html
________________________________________

:

Thank you so much for your reply. I have now retaken some test pics which now
take up between 15 & 35Kb each - smaller than 'Northwind'
Yes 'Northwind' scroll back and forwards quickly. I have almost copied their
coding, but when I use the wheel on my mouse to scroll through records on the
form, for an instant each change there is a box on screen
'importing................ with a 'cancel' button on it, it only just
appearas before vanishing, but the 'flicker' is annoying !! I would like to
get rid of this, any ideas ?!
Thanks again

Al
 
You need to apply the Registry modification for each specific Image type
you will be displaying.
http://www.mvps.org/access/api/api0038.htm
API: Suppress the "Loading Image" dialog
Author(s)
Dev Ashish


(Q) Instead of storing the images in a table, I'm now string the path
and filename of the files in a table, and using the Image control.
However, I don't want the "Loading Image" dialog to come up. How can I
hide this dialog?

(A) The "Loading Image" dialog is popped up by the filter that's
processing the image. We don't have any direct control over it.

There are two ways to prevent the dialog from coming up.

By changing a registry setting emailed to me by Klaus Oberdalhoff.
HKEY_LOCAL_MACHINE\Software\Microsoft\ Shared Tools\Graphics
Filters\Import\JPEG\Options

Change the ShowProgressDialog key value to "No".



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Tom if I remember correctly, you will have to make the mods for each
user account on the computer.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Thank you all for the help, getting way beyond me ... I might ?! be bold and
try the registry mod. but these vastly complex functions etc. are just beyond
me - where do you learn it ?!?!

Thanks
Al
 
These type of issues are seemingly complex but like 99.9% of all
computer issues, someone before you has already figured out a solution
to the problem. By learning to effectively search GoolgeGroups, MSDN and
the MS KB, you should be able to find step by step instructions to fix
the overwhelming majority of computer related issues(and appear very
intelligent to your peers<grin>).

The Registry mod is very simple. The specific Registry Key most likely
already exists and is currently set to Yes. You just change it to No.

What really needs to be done is for someone to produce a simple
application in Access to address this specific issue. I'll put it on my
never ending Access ToDo list.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Thank you all for your help, enjoying the challenge -but !?
Unfortunately the Registry edit did not have any effect (yes - did re-boot
pc after edit) and really the code module is beyond me, it looks as though I
have to create another form............ ?!
I did try putting code into the form that I am using, but again, had no
effect.
Do the 'Declare function.................. etc. go in the general
declarations section ?!
Sorry to be a pain, but all is going really well apart from this flickering
box appearing - YES I said 'flickering' !!!!
thanks,

Al
 
Stephen Lebans said:
The changes have to be made in HKEY_CURRENT_USER as well if my memory
serves me correctly.

Brilliant - it works !!! - Would never have solved it myself - Thanks very
much !!
Al
 
Back
Top