?
Solved

Automatically insert pictures into a form according to record ID

Posted on 2011-09-19
2
Medium Priority
?
341 Views
Last Modified: 2012-05-12
Hello,
I’m using Access 2007 and I’m trying to insert a picture into a form according to the ID number of the form record,  I have tried the below with a text box as well as an OLE Object, with the text box I get literally text in the box as in: C:\Users\mlaroda\Desktop\MuscleTuneFitness\Pics\9.bmp

With the OLE Object box I get nothing but a blank box, I’m not a programmer so please keep it as simple as possible, the code I have is below

 Private Sub Command120_Click()
       Dim XFLName As Integer
    Dim strPic As String
    XFLName = ID
   
    strPic = ("C:\Users\mlaroda\Desktop\MuscleTuneFitness\Pics\" & XFLName & ".bmp")
    Me.tbl_Con_Photo = strPic


End Sub


Thanks in advance
0
Comment
Question by:mjlaroda
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
ID: 36564066
Here is a sample.
Export Form1 to your db
Make the record source something that has ID in it.

Then play with it

Your control needs to be an image control
You need a control with ID as a control source to be on the form
It can be hiddden, but must exist
Your code needs to be

 Private Sub Command120_Click()
    Dim strPic As String
   
    strPic = ("C:\Users\mlaroda\Desktop\MuscleTuneFitness\Pics\" & Me.ID & ".bmp")
    Me.tbl_Con_Photo.Picture = strPic


End Sub

Picture.mdb
0
 

Author Closing Comment

by:mjlaroda
ID: 36567506
Thanks, its working Yeah.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question