Image Link Still Not Work

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
 
T

Ted Allen

Hi Mike,

It sounds like you may not be working with an image
object. On the toolbar there will be a button that just
says "Image". Click that button and insert the image
object into your form. It will ask you to specify a .jpg
file to display. Just choose any .jpg.

The name of the file to be displayed will be shown under
the .picture property of the object. That is the
property that you want to set equal to the file path and
name in your code.

Note that you should probably add some code to see if
your file exists (you could probably use the Dir()
function). Otherwise, if the file doesn't exist you may
get an error if you try to assign the path. You could
probably create a .jpg that has the text "No image saved"
or something similar and display that .jpg if the file
with the Employee ID isn't found.

Try adding the image object and post back if you still
have problems.

-Ted Allen
-----Original Message-----
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

.
 
M

mikepage5

THAT WORKED WONDERFULLY, THANKS AGAIN!
-----Original Message-----
Hi Mike,

It sounds like you may not be working with an image
object. On the toolbar there will be a button that just
says "Image". Click that button and insert the image
object into your form. It will ask you to specify a .jpg
file to display. Just choose any .jpg.

The name of the file to be displayed will be shown under
the .picture property of the object. That is the
property that you want to set equal to the file path and
name in your code.

Note that you should probably add some code to see if
your file exists (you could probably use the Dir()
function). Otherwise, if the file doesn't exist you may
get an error if you try to assign the path. You could
probably create a .jpg that has the text "No image saved"
or something similar and display that .jpg if the file
with the Employee ID isn't found.

Try adding the image object and post back if you still
have problems.

-Ted Allen
-----Original Message-----
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

.
.
 
M

mikepage5

The image is something that prints out on the individuals
ID card from a report. I cannot get it to work the same
way in the report
-----Original Message-----
Hi Mike,

It sounds like you may not be working with an image
object. On the toolbar there will be a button that just
says "Image". Click that button and insert the image
object into your form. It will ask you to specify a .jpg
file to display. Just choose any .jpg.

The name of the file to be displayed will be shown under
the .picture property of the object. That is the
property that you want to set equal to the file path and
name in your code.

Note that you should probably add some code to see if
your file exists (you could probably use the Dir()
function). Otherwise, if the file doesn't exist you may
get an error if you try to assign the path. You could
probably create a .jpg that has the text "No image saved"
or something similar and display that .jpg if the file
with the Employee ID isn't found.

Try adding the image object and post back if you still
have problems.

-Ted Allen
-----Original Message-----
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

.
.
 
T

Ted Allen

Try putting the code in the OnFormat event of the detail
section of the report. It should work pretty much the
same (just double check your object name to make sure it
matches the name of the image object in your report).

-Ted Allen
-----Original Message-----
The image is something that prints out on the individuals
ID card from a report. I cannot get it to work the same
way in the report
-----Original Message-----
Hi Mike,

It sounds like you may not be working with an image
object. On the toolbar there will be a button that just
says "Image". Click that button and insert the image
object into your form. It will ask you to specify a .jpg
file to display. Just choose any .jpg.

The name of the file to be displayed will be shown under
the .picture property of the object. That is the
property that you want to set equal to the file path and
name in your code.

Note that you should probably add some code to see if
your file exists (you could probably use the Dir()
function). Otherwise, if the file doesn't exist you may
get an error if you try to assign the path. You could
probably create a .jpg that has the text "No image saved"
or something similar and display that .jpg if the file
with the Employee ID isn't found.

Try adding the image object and post back if you still
have problems.

-Ted Allen
-----Original Message-----
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