Combo Box - based on a Query with expressions

DubaiDave

Registered User.
Local time
Today, 16:53
Joined
Nov 25, 2008
Messages
69
Hello,

I have a combo box with RowSource set to 'Table/Query'. The query has five fields, one of which is a concatination of two of the other query fields. eg

Field 1 PersonID
Field 2 David
Field 3 Smith
Field 4 = [David] & " " & [Smith] (David Smith)

Column count is 4
Column widths is 2,2,2,2
ControlSource not set
Bound Column is 3

BUT it will not display David Smith in combo and defaults to PersonID.

Is there a reason why it will not display the expression?

DubaiDave
 
I have just tried this using one of my tables

i created a query with first name, surname and an expression just link yours combining first and second names with a space inbetween

running ghe query creates a record:
Ben Hornshaw Ben Hornshaw


I then created a table and added a combo box to this. in the wizrad of the combo box i added all three fields. it then shows me them in a table view, you can here move the fields arround, which ever one is furthest to the left shows up in the cvombo box when closed. you can simply drag the columns arround by clicking and dragging the header.

When i now run the form and click on the combo box i get a list of the expression, first name, surname but when i click on one the combo box displays the expression, ie full name. i hope this helps
untitled.jpg

untitled.JPG

untitled.jpg
 
Thanks Ben,

I am a newbie and thought that I could display any column and not that it had to be in the first query column.

Having moved it, it works fine.

Thanks

DubaiDave
 

Users who are viewing this thread

Back
Top Bottom