Student info

T

Ted_Chgo

I'm very new (and, therefore, stupid) to Access. I'm attempting to create a
database of information for about 300 kids in a program at my center. I also
want to generate ID cards from this database.
1. How do I generate a unique ID number for each kid? will Autonumber work?
I want the sequential.
2. How do I get photos of this kids into the database so I can print the
photos on ID cards?
Thanks for any help.
 
F

Fred

Autonumber will work for what you describe

Access 2007 might have a simpler way, but through Access 2003 it's pretty
complex for someone new with Access to viably do what you describe with
pictures.

Through Access 200
 
E

Evi

Here's the instructions on how to put pictures into a report - it involves
some Code writing so you may need to ask again about things. I'm going to
suggest that you don't store them in your database. It will turn into an
elephant! Instead do this:

A good way to organize this is to put your pictures into a table TblImage
with

ImageID (Autonumber, Primary Key),

ImgPath, (a text field)

ImgName (a text field)





ImgPath contains the path to the folder that contains your images eg

E:\Downloads\EvsPhotos\Students\

If this is the same path for most of your photos then you can set it as the
Default Value of the ImgPath field in your Table Design View

ImgName has the full name of your picture/photo, including the file
extension.



eg

John.jpg



Keeping path and name separate will be helpful if you every need to move
your photos.



The first record in your TblImage will contain the file path to the default
picture (or clipart) which you want to use if you don't have a picture for
anyone.

Add the photos to this table. (if you have a lot of pictures there is code
which can help you to do this)



In your table which has eg Students add the Number Field ImageID

Make its Default Value the ImageID number of your default image (probably 1)



If you have lots of records in your table already, you could use an Update
Query to update this field to 1 until you have matched student and picture



In the query on which your report or form will be based, as well as the data
from eg your Students table, add ImgPath and ImgName. In an empty column in
the query (in Design View) type



PicPath: ImgPath & ImgName



(this will join the ImagePath and File Name together)



In your report, in Design View go to Insert, Picture. Choose any picture or
clipart to start with - it

doesn't matter.



Size the frame to the size you want it to be.



Click the the newly inserted frame, click on Properties



On the Format tab, next to Picture, delete the file path next to Picture.



Say yes you want to delete the picture.

Next to picture, it will now say (none)

Your Image Frame will remain as a white square. On the Other tab next to
Name type Pic1

Next to Size Mode choose Zoom.

Click on the grey bar above above the section which holds your picture
frame.



In Properties, click on the Events tab and next to On Format. Choose Event
Procedure.



Click just right of that to open a code page



In the code page just above where it says End Sub put





Me.Pic1.Picture = Me.PicPath


Each student will now have their own photo (or a default place holder
picture) and your database keeps its svelt figure
(now if it only worked for middle-aged ladies!)

Evi
 
L

Larry Daugherty

Don't use the Autonumber datatype in the hopes of generating an
unbroken sequence of numbers.. Although Autonumber will always start
generating a sequence it is absolutely, positively not guaranteed to
do so. It's sole purpose in life is to generate guaranteed unique
surrogate primary keys. To use it for any other purpose will
eventually lead to problems that will surface at the most inconvenient
times.

Here's some code I cribbed from one of John Vinson's responses in
February. Change the names of controls, tables and fields
appropriately and you will generate an unbroken sequence.

Private Sub Form_BeforeInsert(Cancel as Integer)
Me!PaymentNo = NZ(DMax("[PaymentNo]", "[Payments]", "[AccountNo] = '"
&
Me!AccountNo & "'"))+1
End Sub

You probably don't want to actually put the photos *in* the database.
If you google "Larry Linson" and "photo" in the Access newsgroups
you'll find some of his very helpful prose on this topic..

HTH
 

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

Top