Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Name Display

Status
Not open for further replies.

meddling

Technical User
Oct 21, 2004
14
US
I am developing an Access Database and I am having some trouble displaying NAMES a certain way.

I have a LastName field and a FirstName field, then i created a DisplayName field, and I wanted it to display the following: "LastName, FirstName". How do I do that?

I tried to convey that on the control source but I can't get it to work.

So after typing all the personal information, I want to use the DisplayName in a different form as a Drop-down box where I will select the client's name.

Can you guys help me out ASAP please???
 
Try combining the two in your query:

fName: LastName & ", " & firstname

And then use fName as the control source.
 
By the way, don't create a DisplayName field. That's just wasting space in your table and introducing one more possible source of data corruption. Just calculate it each time you need it as dRahme described above.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
I am thankful for both of your replies but I do not know what dRahme is refering to. I am not a MS Office Wizard.

I'm not sure what query he is talking about. Is it the query tab where you wanted me to add that Fname information? I do know how... When he said try combining the LastName and FirstName in my query, i don't know what you mean...

Could you guys elaborate a little bit more?
 
Now I was able to display the name how I wanted. But there is just ONE problem. The information is not being saved on that field.

I have a FirstName field, a LastName field and the third field is the DisplayName.

Under the design view, on the DisplayName field, i replaced what was on the control source for:

LastName & ", " & firstname

This worked, but the information on the field is not stored in the DisplayName field.

Where am I supposed to create the Fname field suggested by the first reply to my thread? That's what I am not understanding...
 
For your combo box - create a query like:
Code:
Select [id], ([LastName] & ", " & [FirstName]) as fName from tbl
order by ([LastName] & ", " & [FirstName]);
Then use that query as the source for your combo box.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top