Text in a Text Box

G

Gwen H

I have a database with a table called "loans". This table lists loans with
collateral insurance that is about to expire. The database also has two
queries. "Officers_With_Loans" creates a list of officers who have loans in
the "loans" table whose collateral insurance will expire in the next week.
The query "officersLoans" creates a list of loans whose collateral insurance
will expire within the next week. In other words, I am only looking at loans
whose collateral insurance will expire in the next week. I have two queries
for this; one gives me a list of officers with loans about to expire, and the
other gives me a list of the loans.

I am trying to create a form with two controls. One is a combo box that
lists the officers from the "Officers_With_Loans" query. The other control is
a text box that contains the text of an email message I will send to the
officer selected in the combo box. (We are prohibited from generating emails
from within Office applications - the best I can do is create the email text,
then copy it and paste it into a new email message.)

My question is, how do I make the text box display the text of an email that
includes a list of the loans for the officer selected in the combo box. Here
is the code I tried to type in the text box while I had the form in design
view, but it does not work. (And I hear all you VBA pros laughing as you read
my code and my approach to this problem!)

="Collateral insurance for the following loans will be force placed by the
date listed next to the loan. Please contact the customer at your earliest
convenience to request a copy of current proof of insurance documents, then
send the documents to me by email attachment (scanned to PDF) or by fax
(689-4381). If there is any reason why a loan does not need collateral
insurance, please let me know immediately. " & [vbCrlf] & [vbCRlf] & [loan#]
& " - " & [customer] & " will be forced placed on " & [datePlaced] & [vbCrlf]
& [vbCrlf] & "Thanks!"

Thanks in advance for any help you can give.

GwenH
 
S

Sam Hobbs

It is often difficult to know how much information to provide. In this
situation, I think you provided too much information.

If I understand what you are asking, then you can do something such as the
following in the form load. Note that I used a "+" instead of an "&" but you
should change all to be an "&" for consistency.

Text0 = "Collateral insurance for the following loans will be force placed
by"
Text0 = Text0 + " the date listed next to the loan. Please contact the
customer"
Text0 = Text0 + " at your earliest convenience to request a copy of current"
Text0 = Text0 + " proof of insurance documents, then send the documents to
me"
Text0 = Text0 + " by email attachment (scanned to PDF) or by fax
(689-4381)."
Text0 = Text0 + " If there is any reason why a loan does not need
collateral"
Text0 = Text0 + " insurance, please let me know immediately."
Text0 = Text0 + vbCrLf + vbCrLf & [loan#] & " - " & [customer]
Text0 = Text0 + " will be forced placed on " & [datePlaced]
Text0 = Text0 + vbCrLf & vbCrLf & "Thanks!"
 

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