Lookup box on a form

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

Guest

Hi

I have a lookup box on a Form that when you expand the list you can see
there first name and surname, but after selecting it only displays there
first name. Where i want it to display the whole name

how can i do this??
 
Change the row source property of the combo to
SELECT PersonID, [FirstName] & " " & [LastName] As PersonName FROM YourTable
ORDER BY [FirstName];

Bound Column = 1
Column Widths = 0";2"

You probably don't want to order by first name, but adjust accordingly.
 
Thanks works good.

Have another query. the lookup box show the client name likes it suppose to
but it is suppose to store the client id number in the table but it doesnt do
this it stores the clinet names instead

how can i fix it so that the id number is stored in the table instead

Joan Wild said:
Change the row source property of the combo to
SELECT PersonID, [FirstName] & " " & [LastName] As PersonName FROM YourTable
ORDER BY [FirstName];

Bound Column = 1
Column Widths = 0";2"

You probably don't want to order by first name, but adjust accordingly.

--
Joan Wild
Microsoft Access MVP

Andrew said:
Hi

I have a lookup box on a Form that when you expand the list you can
see there first name and surname, but after selecting it only
displays there first name. Where i want it to display the whole name

how can i do this??
 
Are you certain the name is getting stored in the table and not the ID?
Does your table have a lookup defined in the table for this? If so, it only
'appears' to store the name and not the ID. I suggest you remove the lookup
properties in the table - select the field in design view and on the Lookup
Tab at the bottom change it to textbox instead of combobox.


--
Joan Wild
Microsoft Access MVP

Andrew said:
Thanks works good.

Have another query. the lookup box show the client name likes it
suppose to but it is suppose to store the client id number in the
table but it doesnt do this it stores the clinet names instead

how can i fix it so that the id number is stored in the table instead

Joan Wild said:
Change the row source property of the combo to
SELECT PersonID, [FirstName] & " " & [LastName] As PersonName FROM
YourTable ORDER BY [FirstName];

Bound Column = 1
Column Widths = 0";2"

You probably don't want to order by first name, but adjust
accordingly.

--
Joan Wild
Microsoft Access MVP

Andrew said:
Hi

I have a lookup box on a Form that when you expand the list you can
see there first name and surname, but after selecting it only
displays there first name. Where i want it to display the whole
name

how can i do this??
 
Back
Top