Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've read the posts on this, but I am sooo confused. I'm attaching my database and hope someone can take a look and tell me how to fix this. I am creating employee badges (3 x 5 labels) and need the employee's name and picture to show. I have read so much about this, and it seems I need to insert a picture and delete the name. Then, I am supposed to add an on format event or code... and this is where I fall apart. I don't know what method to use, and I have no idea how to modify code.

    Is anyone willing to take a look and tell me what I need to do?

    Thank you!
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    In the first place, you need to be consistent. Your report refers to field names that do not exist in the query (or table), and to controls that do not exist on the report.

    Assuming that you store the employees' pictures in the same folder as the database, you should fill the PHOTOGRAPH_FILENAME field with the filenames only, without the path and without the extension .jpg. So for example, if an employee's picture is named Jones.jpg, you should enter Jones in the PHOTOGRAPH_FILENAME field.

    In the attached zip file, I've added some pictures created from Microsoft's sample employee pictures that came with Access 2002.

    Here is the code used for the report:

    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
      Dim strPath As String
      strPath = CurrentProject.Path & "\" & Me.PHOTOGRAPH_FILENAME & ".JPG"
      If Dir(strPath) = "" Then
    	Me.Image6.Visible = False
      Else
    	Me.Image6.Visible = True
    	Me.Image6.Picture = strPath
      End If
    End Sub
    Attached Files Attached Files

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you, Hans. I started out being consistent! I promise! But, I got so confused with the code that I started renaming things. Anyway, it works now. Thank you so very much, once again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •