Pictures - please explain code !? (Northwind)

A

al9315

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
 
D

Douglas J. Steele

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.
 
J

James Hahn

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.
 
A

al9315

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
 
T

Tom Wickerath

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
 
A

al9315

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
 
T

Tom Wickerath

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
 
T

Tom Wickerath

Thanks Stephen -- I'll give this a try.

Tom
_____________________________________
 
A

al9315

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
 
A

al9315

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
 
A

al9315

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
 
Top