Image Link

M

mikepage5

Is it possible to have an access dbase ole object
automatically filled when a new record is added.

example, an employee table with employee id picture.

have an event vb procedure occur when a button is click
on that will look for a picture in a preset location
i.e. a server folder
X:\empdbase\emppics\[empid].jpg
where it automatically fills in the name of the image
based on employee id number and the image when added to
the folder is named by the id number?

I am sure that this is possible, just hoping someone may
have some clues as to how to get this to happen, My
attempts have not been successful to date.
I will add any person who assists note to the vb
 
R

Roger Carlson

Ordinarily, you don't store the image itself in the database. Oh sure,
Access is capable of it, but it bloats the database very quickly. A better
solution is to store just the path to the image in the database and the
programmatically load the image into your form or report.

On my website is a small sample database called "Picture" which illustrates
how to do this.
 
M

Mikepage5

I do set them as linked, however I want code that will
input the ole object automatically based on a preset path
and then the [empid].jpg without the user having to go
searching for the picture everytime.
-----Original Message-----
Ordinarily, you don't store the image itself in the database. Oh sure,
Access is capable of it, but it bloats the database very quickly. A better
solution is to store just the path to the image in the database and the
programmatically load the image into your form or report.

On my website is a small sample database
called "Picture" which illustrates
how to do this.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

mikepage5 said:
Is it possible to have an access dbase ole object
automatically filled when a new record is added.

example, an employee table with employee id picture.

have an event vb procedure occur when a button is click
on that will look for a picture in a preset location
i.e. a server folder
X:\empdbase\emppics\[empid].jpg
where it automatically fills in the name of the image
based on employee id number and the image when added to
the folder is named by the id number?

I am sure that this is possible, just hoping someone may
have some clues as to how to get this to happen, My
attempts have not been successful to date.
I will add any person who assists note to the vb


.
 
R

Roger Carlson

I'm sorry, then. I'm not understanding the question.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

Mikepage5 said:
I do set them as linked, however I want code that will
input the ole object automatically based on a preset path
and then the [empid].jpg without the user having to go
searching for the picture everytime.
-----Original Message-----
Ordinarily, you don't store the image itself in the database. Oh sure,
Access is capable of it, but it bloats the database very quickly. A better
solution is to store just the path to the image in the database and the
programmatically load the image into your form or report.

On my website is a small sample database
called "Picture" which illustrates
how to do this.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

mikepage5 said:
Is it possible to have an access dbase ole object
automatically filled when a new record is added.

example, an employee table with employee id picture.

have an event vb procedure occur when a button is click
on that will look for a picture in a preset location
i.e. a server folder
X:\empdbase\emppics\[empid].jpg
where it automatically fills in the name of the image
based on employee id number and the image when added to
the folder is named by the id number?

I am sure that this is possible, just hoping someone may
have some clues as to how to get this to happen, My
attempts have not been successful to date.
I will add any person who assists note to the vb


.
 
M

mikepage5

Hopefully this will help to better clarify what I am
trying to do.

I want the user to input a New Employee record with all
of the important data such as address phone number ect..
After the data has been placed in the record, the user
takes a digital photo of the employee, crops it to the
shape required and saves it as lets say, the employees
name or id. this is something that is in the database as
a field within the record i.e. [EFirstName][ELastName] or
[EmpID]
I want the user to then be able to only have to click on
a button to add the picture to the table as an ole object
the button should run a VB code that would fill in the
object with the correct picture by a preset path and
using data already placed in the database as the name of
the object.
click on button -> link to
X:\EmpDbase\emppics\[EFirstName]&[ELastName].jpg
or
X:\EmpDbase\emppics\[EmpID].jpg
-----Original Message-----
I do set them as linked, however I want code that will
input the ole object automatically based on a preset path
and then the [empid].jpg without the user having to go
searching for the picture everytime.
-----Original Message-----
Ordinarily, you don't store the image itself in the database. Oh sure,
Access is capable of it, but it bloats the database
very
quickly. A better
solution is to store just the path to the image in the database and the
programmatically load the image into your form or report.

On my website is a small sample database
called "Picture" which illustrates
how to do this.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

mikepage5 said:
Is it possible to have an access dbase ole object
automatically filled when a new record is added.

example, an employee table with employee id picture.

have an event vb procedure occur when a button is click
on that will look for a picture in a preset location
i.e. a server folder
X:\empdbase\emppics\[empid].jpg
where it automatically fills in the name of the image
based on employee id number and the image when added to
the folder is named by the id number?

I am sure that this is possible, just hoping someone may
have some clues as to how to get this to happen, My
attempts have not been successful to date.
I will add any person who assists note to the vb


.
.
 
T

Ted Allen

Hi Mike,

I think that you and Roger are basically saying the same
thing. Roger had mentioned storing the path and then
programmatically loading the image. What this means is
that every time you view a record on the form, the proper
image would be displayed (loaded) in an image object
based on either a stored path, or a path constructed from
the employee id. It seems like this is what you want to
do (unless I am also not understanding your post).

If you have an organized method of storing and naming
your images, you wouldn't even have to store the path.
You could just create the file path and name in code
running on the form's Current event, and then set that to
be the picture source for an image object.

For example (air code):

Private Sub Form_Current()

Dim StrFilePath as String

strFilePath = "X:\empdbase\emppics\" & Me![ID] & ".jpg"
Me.MyImageObject.Picture = strFilePath

End Sub

Of course, you would want to add some type of error
handler and/or check to see if a file exists, but I think
this will give you an idea of how to approach this.

The example that Roger mentioned on his website will
probably also give you more ideas.

Hope this helps.

-Ted Allen

-----Original Message-----
I do set them as linked, however I want code that will
input the ole object automatically based on a preset path
and then the [empid].jpg without the user having to go
searching for the picture everytime.
-----Original Message-----
Ordinarily, you don't store the image itself in the database. Oh sure,
Access is capable of it, but it bloats the database
very
quickly. A better
solution is to store just the path to the image in the database and the
programmatically load the image into your form or report.

On my website is a small sample database
called "Picture" which illustrates
how to do this.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

mikepage5 said:
Is it possible to have an access dbase ole object
automatically filled when a new record is added.

example, an employee table with employee id picture.

have an event vb procedure occur when a button is click
on that will look for a picture in a preset location
i.e. a server folder
X:\empdbase\emppics\[empid].jpg
where it automatically fills in the name of the image
based on employee id number and the image when added to
the folder is named by the id number?

I am sure that this is possible, just hoping someone may
have some clues as to how to get this to happen, My
attempts have not been successful to date.
I will add any person who assists note to the vb


.
.
 
R

Roger Carlson

That's what I assumed in my original answer. I would NOT store the picture
as an OLE object in the database. I would only store the path to the
picture (as text) in a field and then programmatically load the picture into
an unbound image control in a form or report. This is different than loading
it into the database. The image is never stored in the database.

My sample shows how this works. If the name of the picture is the same as
the ID and the path is always the same, you can hard-code the path in the
code and just concatenate the ID value. In that case you don't even need to
store the picture path at all.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org


mikepage5 said:
Hopefully this will help to better clarify what I am
trying to do.

I want the user to input a New Employee record with all
of the important data such as address phone number ect..
After the data has been placed in the record, the user
takes a digital photo of the employee, crops it to the
shape required and saves it as lets say, the employees
name or id. this is something that is in the database as
a field within the record i.e. [EFirstName][ELastName] or
[EmpID]
I want the user to then be able to only have to click on
a button to add the picture to the table as an ole object
the button should run a VB code that would fill in the
object with the correct picture by a preset path and
using data already placed in the database as the name of
the object.
click on button -> link to
X:\EmpDbase\emppics\[EFirstName]&[ELastName].jpg
or
X:\EmpDbase\emppics\[EmpID].jpg
-----Original Message-----
I do set them as linked, however I want code that will
input the ole object automatically based on a preset path
and then the [empid].jpg without the user having to go
searching for the picture everytime.
-----Original Message-----
Ordinarily, you don't store the image itself in the database. Oh sure,
Access is capable of it, but it bloats the database
very
quickly. A better
solution is to store just the path to the image in the database and the
programmatically load the image into your form or report.

On my website is a small sample database
called "Picture" which illustrates
how to do this.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

Is it possible to have an access dbase ole object
automatically filled when a new record is added.

example, an employee table with employee id picture.

have an event vb procedure occur when a button is click
on that will look for a picture in a preset location
i.e. a server folder
X:\empdbase\emppics\[empid].jpg
where it automatically fills in the name of the image
based on employee id number and the image when added to
the folder is named by the id number?

I am sure that this is possible, just hoping someone may
have some clues as to how to get this to happen, My
attempts have not been successful to date.
I will add any person who assists note to the vb


.
.
 
M

mikepage5

That is what I am looking for THANKS ALOT!

You both rock!
I bow, I am not worthy!

Thanks for the help, Maybe either of you can fix my
problem on General Questions about delete PLEASE PLEASE
PLEASE
Sorry, didn't mean to beg :)
-----Original Message-----
Hi Mike,

I think that you and Roger are basically saying the same
thing. Roger had mentioned storing the path and then
programmatically loading the image. What this means is
that every time you view a record on the form, the proper
image would be displayed (loaded) in an image object
based on either a stored path, or a path constructed from
the employee id. It seems like this is what you want to
do (unless I am also not understanding your post).

If you have an organized method of storing and naming
your images, you wouldn't even have to store the path.
You could just create the file path and name in code
running on the form's Current event, and then set that to
be the picture source for an image object.

For example (air code):

Private Sub Form_Current()

Dim StrFilePath as String

strFilePath = "X:\empdbase\emppics\" & Me![ID] & ".jpg"
Me.MyImageObject.Picture = strFilePath

End Sub

Of course, you would want to add some type of error
handler and/or check to see if a file exists, but I think
this will give you an idea of how to approach this.

The example that Roger mentioned on his website will
probably also give you more ideas.

Hope this helps.

-Ted Allen

-----Original Message-----
I do set them as linked, however I want code that will
input the ole object automatically based on a preset path
and then the [empid].jpg without the user having to go
searching for the picture everytime.
-----Original Message-----
Ordinarily, you don't store the image itself in the database. Oh sure,
Access is capable of it, but it bloats the database
very
quickly. A better
solution is to store just the path to the image in the database and the
programmatically load the image into your form or report.

On my website is a small sample database
called "Picture" which illustrates
how to do this.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

Is it possible to have an access dbase ole object
automatically filled when a new record is added.

example, an employee table with employee id picture.

have an event vb procedure occur when a button is click
on that will look for a picture in a preset location
i.e. a server folder
X:\empdbase\emppics\[empid].jpg
where it automatically fills in the name of the image
based on employee id number and the image when added to
the folder is named by the id number?

I am sure that this is possible, just hoping someone may
have some clues as to how to get this to happen, My
attempts have not been successful to date.
I will add any person who assists note to the vb


.
.
.
 
M

Mikepage5`

It appears to work fine inputing the string into a text
field however it does not seem to be affecting the object
at all.

I tried to see if it would change anything if I did it
with a text field when nothing happened with the object.
When I clicked on the button, the string or path with the
correct idnum.jpg at the end appeared in the text field.
but when I attempted with the object, No change.

This is what I have inputed:
--------------------------------
Private Sub Command2_Click()
Dim StrFilePath As String
StrFilePath = "F:\dbase\EmpPics\IDPics\" & Me![idnum]
& ".jpg"
Me.scannedpicture = StrFilePath

End Sub
--------------------------------

scannedpicture is the name of the OleObject field
that I want the image to fill

-----Original Message-----
Hi Mike,

I think that you and Roger are basically saying the same
thing. Roger had mentioned storing the path and then
programmatically loading the image. What this means is
that every time you view a record on the form, the proper
image would be displayed (loaded) in an image object
based on either a stored path, or a path constructed from
the employee id. It seems like this is what you want to
do (unless I am also not understanding your post).

If you have an organized method of storing and naming
your images, you wouldn't even have to store the path.
You could just create the file path and name in code
running on the form's Current event, and then set that to
be the picture source for an image object.

For example (air code):

Private Sub Form_Current()

Dim StrFilePath as String

strFilePath = "X:\empdbase\emppics\" & Me![ID] & ".jpg"
Me.MyImageObject.Picture = strFilePath

End Sub

Of course, you would want to add some type of error
handler and/or check to see if a file exists, but I think
this will give you an idea of how to approach this.

The example that Roger mentioned on his website will
probably also give you more ideas.

Hope this helps.

-Ted Allen

-----Original Message-----
I do set them as linked, however I want code that will
input the ole object automatically based on a preset path
and then the [empid].jpg without the user having to go
searching for the picture everytime.
-----Original Message-----
Ordinarily, you don't store the image itself in the database. Oh sure,
Access is capable of it, but it bloats the database
very
quickly. A better
solution is to store just the path to the image in the database and the
programmatically load the image into your form or report.

On my website is a small sample database
called "Picture" which illustrates
how to do this.

--
--Roger Carlson
www.rogersaccesslibrary.com
Reply to: Roger dot Carlson at Spectrum-Health dot Org

Is it possible to have an access dbase ole object
automatically filled when a new record is added.

example, an employee table with employee id picture.

have an event vb procedure occur when a button is click
on that will look for a picture in a preset location
i.e. a server folder
X:\empdbase\emppics\[empid].jpg
where it automatically fills in the name of the image
based on employee id number and the image when added to
the folder is named by the id number?

I am sure that this is possible, just hoping someone may
have some clues as to how to get this to happen, My
attempts have not been successful to date.
I will add any person who assists note to the vb


.
.
.
 

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