Need coded return key in form field

Hey Lucy

Registered User.
Local time
Today, 12:40
Joined
Jan 20, 2012
Messages
124
As per client request....

I have a form that has his closing attorney information in it (for real estate transactions). The form has your general atty name, firm, addr, city, state, zip, phone, cell, & email fields with a few other fields.

The name of the firm will be linked on another form (Properties Under Contract), but he wants ALL the contact info in one field on the PUC form. I can create a field on the Atty form that will be hidden that will basically concatenate the information. Here is example:

=[Addr]+"," + " "+[City]+","+ " "+[State]+" "+[Zip]

which returns:

123 Main Street, Anywhere, Montana 12345

Fine and good, but I want to be able to add a hard return to this same field, then add the phone info, something like this:

=[Addr]+"," + " "+[City]+","+ " "+[State]+" "+[Zip]
+[MainPhone]"/"[MobilePhone]
+

So the return would show on each different line of the field like this:

123 Main Street, Anywhere, Montana 12345
555-123-5478/555-232-8941
johndoe@anycompany.com

NOT Visual Basic but written in the actual field on the form. My problem is how do I get it to put a hard return in so that I can have a 2nd and 3rd line in that field?

Any ideas? Thanks for any help you can give. I don't know how to program in VB.
 
Use the character codes for Carriage Return and Line Feed - Chr(13) & Chr(10).

=[Address ] & ", " & [City] & ", " & " " & [State] & " " & [Zip] & Chr(13) & Chr(10) & [MainPhone] & "/" & [MobilePhone] & Chr(13) & Chr(10) &
 
Sean,

Thank you so much once again! I'm the student, you're my teacher. Once I learn about something I don't forget it, so I'll be using this string expression again. I have just never learned about the Carriage Return and Line Feed codes before!!! Never taken on a course on Access or VB, so I'm a learn-as-you-go, although I have successfully (somehow) managed to create and sell Access databases I have created.

Thanks again so very much!
 
note there is an easy shortcut for those and some other characters

vbcrlf is chr(13) & chr(10)
vbcr is just chr(13)
vbtab is a tab character

so simply

strg1 & vbcrlf & strg2
 
note there is an easy shortcut for those and some other characters

vbcrlf is chr(13) & chr(10)
vbcr is just chr(13)
vbtab is a tab character

True, but the OP specifically wanted to be able to use this directly in the Control Source with no vb, so had to do it the long way.
 
Thanks to both of you. Not a vb programmer...sigh...need to learn when time permits
 

Users who are viewing this thread

Back
Top Bottom