Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Join Date
    Oct 2003
    Location
    Finland
    Posts
    80

    Unanswered: Pictures in report

    I'm trying to make a report that could print out ID cards from a database. The database holds each persons first name, last name, title, training program and a path to his/her picture.

    The problem is that the report shows only the first picture in the database for all the people. I can't figure out how to update the picture path to the next card.

    This is the code that I used to get the pictures in the report:

    Private Sub Report_Activate()

    Me![Pic1].Picture = Me![PicPath]

    End Sub

  2. #2
    Join Date
    Oct 2003
    Posts
    16

    Re: Pictures in report

    Have you tried putting your code in the On Format event of the detail section of the report? Report_Activate() only executes once, not for each record.


    Originally posted by Sham81
    I'm trying to make a report that could print out ID cards from a database. The database holds each persons first name, last name, title, training program and a path to his/her picture.

    The problem is that the report shows only the first picture in the database for all the people. I can't figure out how to update the picture path to the next card.

    This is the code that I used to get the pictures in the report:

    Private Sub Report_Activate()

    Me![Pic1].Picture = Me![PicPath]

    End Sub

  3. #3
    Join Date
    Oct 2003
    Location
    Finland
    Posts
    80
    I must be doing something wrong. I got and error message saying "type mismatch".

  4. #4
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Put the this code in the format :

    Dim ruta as string

    ruta = Me![PicPath]
    Me![Pic1].Picture = ruta
    Saludos
    Norberto

  5. #5
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Sorry:Put the this code in the on format event:

    Dim ruta as string

    ruta = Me![PicPath]
    Me![Pic1].Picture = ruta
    Saludos
    Norberto

  6. #6
    Join Date
    Oct 2003
    Location
    Finland
    Posts
    80
    Now I get a error message saying "Object doesn't support this property or method".

  7. #7
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Check in your base the field PicPath must be in string format and tell me
    how is that field.
    Saludos
    Norberto

  8. #8
    Join Date
    Oct 2003
    Location
    Finland
    Posts
    80
    How can I change it to String?

  9. #9
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Text format
    Saludos
    Norberto

  10. #10
    Join Date
    Oct 2003
    Posts
    16
    Is the field on your report and image object?

    If your still having trouble try it one step at a time:

    1. bind the report to your table or query that contains the text field with the picture path.

    2. Add an image object to report detail section and name it PIC1

    3. Add a textbox named PICPATH to the report detail section and bind it to the table/query field containing the picture path.

    4. Add the following code to the report:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Pic1.PICTURE = PICPATH
    End Sub

    I put together a sample MDB, if you need it.

    Originally posted by Sham81
    Now I get a error message saying "Object doesn't support this property or method".

  11. #11
    Join Date
    Oct 2003
    Location
    Finland
    Posts
    80
    No good... still giving the "type mismatch" error.

  12. #12
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    Do like viper_mm say, have reason.
    Saludos
    Norberto

  13. #13
    Join Date
    Oct 2003
    Location
    Finland
    Posts
    80
    I did what viper_mm told, but it didn't work.

  14. #14
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    If you want send me a sample base in Access 97 and see what i can do
    ok
    Saludos
    Norberto

  15. #15
    Join Date
    Oct 2003
    Posts
    16
    Did you get any sort of error or just no output?

    Originally posted by Sham81
    I did what viper_mm told, but it didn't work.

Posting Permissions

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