By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Choosing an image on a form, sending it to a report

P: n/a
Hi all,

I have a simple problem that hopefully has a simple solution, but I
have yet to figure it out. In a patient database, I have a physician
test order form that populates a report that is then printed and
mailed out or faxed. It would be nice to have the doc's electronic
signature show up on this report, but we have 4 or 5 docs that order
tests.

So, I would like to use a combo box on this form to select from a
short list of image files (4 or 5 very small images of signatures),
and then have the selected image sent to the report.

Is there an easy way of doing this?

Many thanks in advance,

Randal Morris
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Randal,

You open the report with code from a form FrmSelectDoctor?
On this form you have chosen the doctor in cboSelectDoctor?

Create an imagecontrol on your report, call it e.g. imgSignature
Now at runtime you need to change the property imgSignature.Picture
You need to point this to a selected doctor in 'cboSelectDoctor' on your Form 'FrmSelectDoctor'

Private Sub Report_Open(Cancel As Integer)
Select case Forms!FrmSelectDoctor!cboSelectDoctor
Case "Doctor1"
Me!imgSignature.Picture = "C:\Images\Signature1"
Case "Doctor2"
Me!imgSignature.Picture = "C:\Images\Signature2"
Case "Doctor3"
Me!imgSignature.Picture = "C:\Images\Signature3"
Case else
Me!imgSignature.Picture = "" 'No picture
End select
End Sub

--
Hope this helps
Arno R

"Ranman" <rm*****@utmb.edu> schreef in bericht
news:59**************************@posting.google.c om...
Hi all,

I have a simple problem that hopefully has a simple solution, but I
have yet to figure it out. In a patient database, I have a physician
test order form that populates a report that is then printed and
mailed out or faxed. It would be nice to have the doc's electronic
signature show up on this report, but we have 4 or 5 docs that order
tests.

So, I would like to use a combo box on this form to select from a
short list of image files (4 or 5 very small images of signatures),
and then have the selected image sent to the report.

Is there an easy way of doing this?

Many thanks in advance,

Randal Morris


Nov 12 '05 #2

P: n/a
First, to get on the same page as you, if a report is not based on a
table (or a query of a table), then it displays the default values of
the controls in the report (textboxes, etc), a static display. If the
report is going to display assigned values (like from a form), those
values need to be stored in a table and the report will display the
values from the table. This being the case, the data being displayed on
the form must be stored in a table. In that table you probably have a
field for the Doctor's name. Since you have on the 4 or 5 doctors, then
you may have say 100 records. 20 of the records are from dr.1, 30 from
dr.2, 15 from dr.3, 10 from dr.4, and 25 from dr.5.

So in the drName field you could have either dr.1, dr.2, dr.3, dr.4, or
dr.5. So lets assume you have 5 pictures of each doctor's signature Dr.
Joe Smith, Dr. Sue Jones, ...

Now, in the Report design view include an Image control in the Detail
section where all the textboxes are (in the property sheet of the Image
contorl - for Picture type - select linked, for picture select (none),
for sizemode you could experiment with clip, zoom, or stretch). In the
Report code Module (the report is based on the table that the data form
is based on) you write this code in the Report's code module in the
Detail_Format section:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If txtDrName = "dr.1" Then
Image1.Picture = "C:\somedir\dr1.bmp"
ElseIf txtDrName = "dr.2" Then
Image1.Picture = "C:\somedir\dr2.bmp"
ElseIf txtDrName = "dr.3" Then
Image1.Picture = "C:\somedir\dr3.bmp"
ElseIf txtDrName = "dr.4" Then
Image1.Picture = "C:\somedir\dr4.bmp"
ElseIf txtDrName = "dr.5" Then
Image1.Picture = "C:\somedir\dr5.bmp"
End If
End Sub

Now each record in your report will have a picture of the corresponding
Dr's signature.

To get to the Report's code module you can click on this square like
icon on one of the toolbars in the Report's design view - should be
right about the middle of the Design view near the top. Once in the
code module you get to the Detail_Format section by selecting Detail
from the left dropdown box at the top left of the code window, and then
selecting Format from the right dropdown box at the top right of the
code window.

Rich

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

P: n/a
Rich,

I tried what you suggested, and it works like a charm. Many, many
thanks to you, sir!

Randal Morris


Rich P <rp*****@aol.com> wrote in message news:<3f*********************@news.frii.net>...
First, to get on the same page as you, if a report is not based on a
table (or a query of a table), then it displays the default values of
the controls in the report (textboxes, etc), a static display. If the
report is going to display assigned values (like from a form), those
values need to be stored in a table and the report will display the
values from the table. This being the case, the data being displayed on
the form must be stored in a table. In that table you probably have a
field for the Doctor's name. Since you have on the 4 or 5 doctors, then
you may have say 100 records. 20 of the records are from dr.1, 30 from
dr.2, 15 from dr.3, 10 from dr.4, and 25 from dr.5.

So in the drName field you could have either dr.1, dr.2, dr.3, dr.4, or
dr.5. So lets assume you have 5 pictures of each doctor's signature Dr.
Joe Smith, Dr. Sue Jones, ...

Now, in the Report design view include an Image control in the Detail
section where all the textboxes are (in the property sheet of the Image
contorl - for Picture type - select linked, for picture select (none),
for sizemode you could experiment with clip, zoom, or stretch). In the
Report code Module (the report is based on the table that the data form
is based on) you write this code in the Report's code module in the
Detail_Format section:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If txtDrName = "dr.1" Then
Image1.Picture = "C:\somedir\dr1.bmp"
ElseIf txtDrName = "dr.2" Then
Image1.Picture = "C:\somedir\dr2.bmp"
ElseIf txtDrName = "dr.3" Then
Image1.Picture = "C:\somedir\dr3.bmp"
ElseIf txtDrName = "dr.4" Then
Image1.Picture = "C:\somedir\dr4.bmp"
ElseIf txtDrName = "dr.5" Then
Image1.Picture = "C:\somedir\dr5.bmp"
End If
End Sub

Now each record in your report will have a picture of the corresponding
Dr's signature.

To get to the Report's code module you can click on this square like
icon on one of the toolbars in the Report's design view - should be
right about the middle of the Design view near the top. Once in the
code module you get to the Detail_Format section by selecting Detail
from the left dropdown box at the top left of the code window, and then
selecting Format from the right dropdown box at the top right of the
code window.

Rich

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.