Dan,
Now I think that I understand what you are trying to do.
Here is my suggestion.
First, I would not use an OLD control in the report, but use an Image control.
Next, in your "tblSignatures" add a field for the complete "Path" to where
each of the bitmap images is stored. Then save the path to each Doctor's
signature in the record for each doctor. If is not clear to me if in fact you
have the doctor's actual name as a field in your table, but if not, I would
suggest that you include a field for the doctor's name. You will not need
your Signature field which I have come to believe is an ole type field.
Next, have your combo box to show each doctor's name but have the first
column be the RACF field. You can have all requied info to be held in the
combo box if you would like.
Your sql statement would include the RACF, DoctorName, and the ImagePath
fields. (Your actual field names can be what ever you want but I have just
used some names for describing what I am suggesting.
Once you have your row source for your combo box providing the RACF,
DoctorName, and the ImagePath fields, you will need to set the following
properties for your combo box.
Set the Column Count to 3
Set the Column Widths to: 0";1.2";0 (the 1.2 value can be the same as the
Width property of the combo box. The first and last zeros hide the "RACF"
field and the "ImagePaths" from being seen when the combo box is dropped
down.)
When you try you combo box, you should now only see the list of Doctor's
names. You will not see the RACF field or the ImagePath fields in the combo
box, however there values are available from the combo box through code.
Now, in your report, place an Image control. (you should rename this control
to something like "imgSigature" just for referencing purposes.
Next, in the section of your report where the Image control is located,
place the following code:
Dim strSgnturPath As String
strSgnturPath = Forms!FromName.ComboboxName.Column(2)
Me.imgSigature.Picture = strSgnturPath
Now with a doctor selected in your combo box, preview your report. You
should see the graphic of the signature specified in the ImagePath field in
your table.
--
HTH
Mr B
askdoctoraccess dot com
Dan @BCBS said:
They are bitmap images of the hand written signatures.
Is there any hope to adding this OLE through the report or do I need to go
back to adding the combo box choice to the command button that opens the
report?
Thanks
:
Well, I just did not pickup on the fact that on of your fields is an ole
object.
The concept that we have been discussing will not work for old objects.
Are the signatures that you want to display actually in some graphic format?
--
HTH
Mr B
askdoctoraccess dot com
:
My appoligies - I've been working to resolve this and tried both:
SELECT [tblSignatures].[RACF], [tblSignatures].[Name] FROM tblSignatures;
SELECT * FROM tblSignatures WHERE racf in ('uym3','ha00','ha87');
Yes, my form is open, I use the command button to open the report!
In regards to the row source above, RACF is the unique field for each
doctor, Name is the field that displays in the combo box.
Then on the report I'm trying to display the "signature" which is an OLE
object.
With this Select statement in the text box on the report, I would expect to
see the Name vlaue but this is what displays: #Name:
SELECT [tblSignatures].[RACF], [tblSignatures].[Name] FROM tblSignatures;
Again - the goal is to get the signature value to display in the report text
box!
Suggestions?
:
Ok, Dan.
Let's see if we can resolve this.
In your previous post you said that the Row source for your combo box was:
SELECT [tblSignatures].[RACF], [tblSignatures].[Name] FROM tblSignatures;
IF this is true then only two fields are being returned in the combo box.
The select statement determines the fields that are available to the combo
box not the table.
I have been assuming that your form is open when you preview your report.
Is this true?
--
HTH
Mr B
askdoctoraccess dot com
:
I really appreciate your assistance - this Doctors signature is the final
step before I roll this db to production.
Anyway:
The value needed (signature) for the report is the 3rd column in the table.
When the report text box has: =[Forms]![f_LetterMenu]!cboSignatures
Results = "# ERROR"
When the report text box has: =[Forms]![f_LetterMenu]!cboSignatures.column(1)
Results = "# NAME"
When the report text box has: =[Forms]![f_LetterMenu]!cboSignatures.column(3)
Results = "# NAME"
Suggestions?
:
Dan,
The control source you have for your text box will return the value that is
the "Bound column" of your combo box.
You row source is returning two columns of data: RACF and Name. If you have
the Bound Column of your combo box set to 1 then the value that should be
shown in your text box when you preview the report would be the value in the
RACF field. If you wan the Name field then use:
"=[Forms]![f_LetterMenu]!cboSignatures.column(1)"
Are you seeing any value at all in text box in your report or are you still
getting the Error?
--
HTH
Mr B
askdoctoraccess dot com
:
Yes, to your statement: "then the text box that has the
"=[Forms]![f_LetterMenu]!cboSignatures" as its control source...."
That leads me to your next comments refering to the combo box.
This is the Row Source to my combo box:
SELECT [tblSignatures].[RACF], [tblSignatures].[Name] FROM tblSignatures;
And as you suggested, this is the Control Source to my text box on the report:
=[Forms]![f_LetterMenu]!cboSignatures
"BUT" I noticed something - the signature field in the table that I want to
place in the report (called: signature) is not part of the text box Control
Source or anything!!
Correct me if I'm wrong but - should my command button on the form read in
the choice the user makes.. Then the report text box should be the actual
variable I want to see called "signature"???
Is it possible to just add the combo box choice "cboSignature" to this code
below??
stDocName = "rptThankYou"
stLinkCriteria = "[ICNNo]='" & Me![ICNNo] & _
"' AND [ProvNo] = '" & Me!f_ProvSub!ProvNo & "'"
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
:
Dan,
When I referred to the "Control Source" I was refering to the source for
your text box on your report.
I would expect that your combo box would have a record source. However, the
way you have your row source built, it will return all fields in the in the
tblSignatures table. That is not a bad thing, just not somthing that I would
do. I would have the record source for the combo box to only return the
value(s) that I need for the purpose that I am using the combo box. In other
words, if all you need is the Doctor's namd then you can create the row
source that will only return that field. You would still use the same
criteria but only return one field.
I assume that you had your form (f_LetterMenu) open and that you had a
selection made from the cboSignatures combo box when you opened the report.
If this is true, then the text box that has the
"=[Forms]![f_LetterMenu]!cboSignatures" as its control source should have
returned the value selected in the combo box.
With all of the fields being returned to the combo box, you may not have
your combo box setup correctly to return the correct value. How many fields
are in your table? Which column is specified as the Bound column? How many
columns are you setting the combo box to show? If you are showing multiple
columns, what are the values for the column widths?
--
HTH
Mr B
askdoctoraccess dot com
:
I plugged in your first suggestion: =Forms!Form5!cboDoctors - which actually
converts to =[Forms]![f_LetterMenu]!cboSignatures
The results on the report are "# ERROR"
Is this because my Combo Box of Doctors has a row source and not a control
source? The row source points to the table SELECT * FROM tblSignatures WHERE
racf in ('uym3','ha00','ha87');
The reason I cannot make the Combo Box have a control source is because the
query which the form is made from does not have the table with the signatures
(tblSignatures) and I cannot add that table to the query.
Or is it another reason that it's returning # ERROR???
Thanks for the help