Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    May 2003
    Location
    Kansas City, Kansas, USA
    Posts
    76
    Thanks
    1
    Thanked 0 Times in 0 Posts

    OLE Objects (Access 2000)

    Hi Guys! Here I am picking your brains again!!!

    OK- I have a field that is labeled SPED, I want the user when entering data to be able to either choose a picture or leave the field blank.... I haven't worked with OLE objects much and all I seem to be able to do is either show a picture all of the time or none of the time..... ANY SUGGESTIONS WILL BE HELPFUL <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>

  2. #2
    2 Star Lounger
    Join Date
    Aug 2001
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OLE Objects (Access 2000)

    Where will they be choosing the picture from?

  3. #3
    Star Lounger
    Join Date
    May 2003
    Location
    Kansas City, Kansas, USA
    Posts
    76
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: OLE Objects (Access 2000)

    Well, I tried to set up a table with Pictures in it, but found out rather quickly that you can't set a look up field to an OLE object... So I really don't know how else to do it. The pic is a bitmap ........

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OLE Objects (Access 2000)

    In general, it is a bad idea to store pictures in an Access database, unless it concerns a small number of small images. Pictures tend to bloat an Access databas tremendously. It's better to store only the path to picture files in the database. I have attached a simple demo (Access 97, zipped) that demonstrates how to display images in a form and report.

    It's not clear to me how you would want to use an OLE field as a lookup field. Perhaps if you explain what you want to accomplish...
    Attached Files Attached Files

  5. #5
    2 Star Lounger
    Join Date
    Aug 2001
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OLE Objects (Access 2000)

    What is the picture for?
    For example, in the last db I worked on had images in it in two places.
    One form referred huge tiff files, I chose not to store that in the DB - but instead had the users hyperlink to the files (since I knew that they would be working with the files outside of the db. In this scenario, the DB becomes a way of referencing the location of the files quickly.
    In another, users were including screenshots, by copying and pasting them into a form.
    If you wanted to have the user reference say, a picture of a person - you could do a lookup on the person's name and then have it return a record for the person, including their picture.

    Cheers

  6. #6
    Star Lounger
    Join Date
    May 2003
    Location
    Kansas City, Kansas, USA
    Posts
    76
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: OLE Objects (Access 2000)

    Ok here it goes:

    The database is set up for a truancy program. It houses students information and parent information ... Some of the students who are turned in for truancy are special education or SPED. What we wanted to do was have a picture show up when the student is SPED..... this way only those who are SPED have a picture.... So in essence there is only one picture that I would like to be able to choose to "Mark" a student as SPED.

    I hope that makes sense......

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OLE Objects (Access 2000)

    In that case, you don't store any picture in the student table - it is not necessary. You only need to store a yes/no value indicating SPED or not.

    If you have a single form, you can make a fixed image (not bound to a field) visible or not depending on the value of the yes/no field. You would need to do this in two places:
    - In the On Current event of the form, to update the visibility as the user moves from record to record.
    - In the After Update event of the yes/no field, to update the visibility when the student is marked as SPED or not.

    If you have a continuous form, it would take more work.

  8. #8
    Star Lounger
    Join Date
    May 2003
    Location
    Kansas City, Kansas, USA
    Posts
    76
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: OLE Objects (Access 2000)

    I apologize for asking so many questions but,,,, I understand the concept, however I am confused on how to set the properties, do i need code or an expression, or a macro........ <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OLE Objects (Access 2000)

    Let's say that you have added a Yes/No field named SPED to the table.
    On the form, you have a check box chkSPED bound to the SPED field, and an unbound image control named imgSPED.

    Open the form in design view, and activate the Properties window. Make sure that its caption says Form.
    Activate the Event tab, and click in the On Current event.
    Select Event Procedure from the dropdown list.
    Click the Builder button (the three dots ... to the right)
    You're taken to the Visual Basic Editor. The "skeleton" for the On Current event handler has already been created for you.
    Complete it so that it looks as follows:

    Private Sub Form_Current()
    Me.ingSPED.Visible = Me.chkSPED
    End Sub

    Switch back to Access (Alt+F11 or use the Windows task bar)
    Select the check box on the form.
    Activate the Properties window.
    Click in the After Update event.
    Select Event Procedure.
    Click the Builder button.
    Complete the code:

    Private Sub chkSPED_AfterUpdate()
    Me.ingSPED.Visible = Me.chkSPED
    End Sub

    Switch back to Access.
    Close and save the form.
    Open it in form view to test it.

  10. #10
    Star Lounger
    Join Date
    May 2003
    Location
    Kansas City, Kansas, USA
    Posts
    76
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: OLE Objects (Access 2000)

    Thank you Hans so very much.. I really appreciate it.. That was much easier than I was making it out to be.........
    Thanks again! Hey any suggestions on how i can learn code..........books etc......

Posting Permissions

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