automatically insert contact name into subform

A

amjjam

Hi,

I have a tabbed contacts form which is a subform of a companies form. One of
the tabs in the contacts form is titled communication. Communication is a
subform for tracking calls, emails, faxes, etc. I have inserted a text box
into the communication form so the current contact's name associated with
each call or email will be visible. The expression =Forms!Contacts!FirstName
& " " & Forms!Contacts!LastName doesn't fill in the name as I'd like. I get
#Name? as an error message. I've tried putting brackets around each element
in the above equation, but can't get it to work. Is there a way to fill in
the contact's name automatically in the communications subform? Thanks.
 
M

M Skabialka

What is this text box called? If you use the name of one of your fields it
won't work. Call it txtFullName or similar.
 
J

Jeanette Cunningham

Hi amjjam,
if the LastName and FirstName are on the parent form, you can use -->
Me.Parent.LastName and similar for the first name.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
A

amjjam

It's called "ContactsNameText" which is different from the form field names
which are "FirstName" and "LastName."
 
A

amjjam

Hi Jeanette,

Your solution looks like VBL code. I'm a real novice in Access. Right now I
have the expression written in the text box. Where would I put phrasing like
you suggest, and what would it look like to get the contact's first name
followed by a space and the contact's last name? Thanks for your help. This
has me stumped.
 

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