Memo Field Creation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I have a form for data input of an employee record, but one field of the
record is a memo field that needs to be filled out in a uniform wording
style, using some data from other fields on the form.

Example of what the memo will look like for any given patient:

The department of (Department name, displayed in subform employee) will bill
as follows:

(how would I do a line break to preserve the desired formatting?)
Annually=(value in text77)
Quarterly=(value in text77/4)

And that's what it would look like. I was planning on creating a button that
would be clicked to generate the field data in its proper form. Any ideas on
how?

Thanks,

Scott
 
You would set the field value via form code to what it is you wish. Use
vbCRLF where you want a line break.

Inserting data this way into a memo type field may give you problems, I'm
not certain.

memoField.Value = "The department of " & SubForm!DepartmentField.Value & "
will bill as follows: " & vbCRLF & vbCRLF & "Annually=" & text77.Value...and
so on...
 
Hi. I have a form for data input of an employee record, but one field of the
record is a memo field that needs to be filled out in a uniform wording
style, using some data from other fields on the form.

Example of what the memo will look like for any given patient:

The department of (Department name, displayed in subform employee) will bill
as follows:

(how would I do a line break to preserve the desired formatting?)
Annually=(value in text77)
Quarterly=(value in text77/4)

And that's what it would look like. I was planning on creating a button that
would be clicked to generate the field data in its proper form. Any ideas on
how?

Thanks,

Scott

Having this information placed in a Memo field on your form is not the
way to go.

The text is canned text. Am I correct? With the only changes being the
Department name and the data shown in [text77].

You should store the department name and the Value which you show in
[Text77] in your table. That is all the information you need store for
this.

I would assume all of this is eventually a basis for a report.
Include all of the field data needed in the report's record source.
In the Report, not in the Form, add an unbound control.
Set it's control source to:

= "The department of " & [Department name] & " will bill
as follows:" & Chr(13) & chr(10) & "Annually $ " & Format([text77]
,"#,###.00") & Chr(13) & chr(10) & "Quarterly $ " &
Format([text77]/4,#,###.00")
 
Perfect! That is exactly what I needed. One other problem has occurred, though.

On the part "Annually=(Value in text77)...text77 is a calculated value that
involves division, but the field is displayed as currency so that it looks
right. Unfortunately, when I incorporate it in the memo field, it comes as a
5 digit number. Can I get rid of the other three decimal digits I don't want
and keep it looking like a currency?

My guess is that I would need to take text77 into a dim ahead of time and do
something to it to make it only two decimal places long. Would this work and
and how could I implement it? Thanks again!
 
Can I get rid of the other three decimal digits I don't want
and keep it looking like a currency?

You can use the Format() function to format the value however you
like: e.g.

Format(<expression>, "Currency")

will use your Windows regional currency setting.

John W. Vinson[MVP]
 
Back
Top