If you are printing the images in reports, to avoid memory leakage, you
should also see MVP Stephen Lebans' http://www.lebans.com/printfailures.htm.
PrintFailure.zip is an Access97 MDB containing a report that fails during
the Access formatting process prior to being spooled to the Printer Driver.
This MDB also contains code showing how to convert the contents of the Image
control to a Bitmap file prior to printing. This helps alleviate the "Out of
Memory" error that can popup when printing image intensive reports.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Andrew T" <And...@discussions.microsoft.com> wrote in message
news:FDAF7C0A-2C7F-4F2C...@microsoft.com...
>I have a file of jpgs that are listed by student number. They are in the
>same
> folder as the data base I want to use. I need to display the students
> picture
> (400+) and their name and other data. Is there a way these can be
> displayed
> without inserting each one in the table? I think I can build the form but
> am
> not sure how to get the picture and the student infomation to merge.
> --
> Just a simple school teacher trying to stay a head of his class
Sorry but you lost me. I did look at the sample but it is way above what I
understand. Access 2000 is what we are trying to use. We have all the student
pictures in one folder. I just do not want to spend several hours inserting
the locations in the table.
--
Just a simple school teacher trying to stay a head of his class
In the Form's Current event do something like:
Me.ImagePhoto.Picture = "C:\StudentPhotos\" & Me.txtStudentId & ".jpg"
Above assumes the folder containing the student photos is found on your
C drive and is named "StudentPhotos".
You will need to add error handling to allow for the situations where
there is no corresponding StudentPhoto for the current record. Generally
you would create a blank Photo containing the Text "Not Avail" or
something similiar. Use the DIR command to check for the existence of
the Student Photo and then load the Not Avail photo if no file is found.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Andrew T" <And...@discussions.microsoft.com> wrote in message
news:0DE067A0-A495-437E...@microsoft.com...
Thanks for your patients.
--
Just a simple school teacher trying to stay a head of his class
>> Place the standard Image(NOT Bound or Unbound Object Frame)
>>control on your form, name it ImagePhoto.
The control you want is named "Image". AS you hover your Mouse overtop
of the ToolBox controls it will show you the name of each control. I
honestly do not know what else to tell you
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Andrew T" <And...@discussions.microsoft.com> wrote in message
news:C9B28FEF-7541-41D1...@microsoft.com...
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Andrew T" <And...@discussions.microsoft.com> wrote in message
news:56B0D412-DDF0-4392...@microsoft.com...
Thanks
Copy and paste all of the code you have in your Form's CLass module.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Andrew T" <And...@discussions.microsoft.com> wrote in message
news:2521BD32-E815-4546...@microsoft.com...
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Andrew T" <And...@discussions.microsoft.com> wrote in message
news:AE1AEC10-4507-4A4C...@microsoft.com...
Private Sub Form_Current()
Me.ImagePhoto.Picture = "C:\StudentPhotos\" & Me.txtStudentID & ".jpg"
On Error Resume Next
End Sub
I hope that this is correct. It runs but now the error messages says that
Access can not open the file C:\StudentPhotos\(a student number).jpg?
It then directs me back to the code page.
Also we need to add error checking to allow for such conditions as "no
such student photo on file", etc. I'll dig something out of the NG
postings later tonight.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Andrew T" <And...@discussions.microsoft.com> wrote in message
news:622C3DEC-7E22-417D...@microsoft.com...
Private Sub Form_Current()
Dim sFileName as string
sFileName = "C:\StudentPhotos\" & Me.txtStudentID & ".jpg"
' See if this photo exists
' Returns a zero length string if file does not exist
sFileName = Dir(sFileName)
If len(sFileName & vbNullString) = 0 Then
' Load "Not Available" Photo
Me.ImagePhoto.Picture = "C:\StudentPhotos\NotAvailable.jpg"
Else
' Load the matching Photo for this StudentID
Me.ImagePhoto.Picture = sFileName
End if
End Sub
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Andrew T" <And...@discussions.microsoft.com> wrote in message
news:622C3DEC-7E22-417D...@microsoft.com...