Hi Rudi:
Well, try the following as the rowsource for the combobox:
SELECT [Employee Details].NameID, [Employee Details].Names & " " & [Employee
Details].Surname AS Expr1
FROM [Employee Details];
Now, you have to decide what you want the combobox to return... i.e. what do
you want Access to "see" when it looks for a value in the combobox. If you
want it to use the NameID, then the "Bound Column" has to be 1, if you want
it to use the concatenated name the "Bound Column" has to be 2. The query
would then look for the following: [Forms]![Timesheet Report
Selection]![EXP1]. Now, if you want the combobox to *display* the full name,
but *return* only the first name (i.e. Names), you need to set it up
differently. In that case your SQL statement could be:
SELECT [Employee Details].Names, [Employee Details].Names & " " & [Employee
Details].Surname AS Expr1
FROM [Employee Details];
In this situation, the bound column would be 1. The column count would be 2.
The column widths could be 0,1.
Now when the query runs, it needs to use the value in the combobox as a
parameter, right? So, if you want to use the first SQL statement, you need
to ensure that the query can use the "new" style name that you've created
for the combobox, i.e. "Fred Boer".
By the way, I see you have named the combobox "Names" which is also the name
of a field in the table. I suggest that you do some research into the use of
a naming convention in your application - it will save you many headaches.
Using a naming convention, you might call the combobox "cboNames", clearly
differentiating it from [Employee Details].Names...
The following link might be useful:
http://www.mvps.org/access/tencommandments.htm
HTH
Fred
Rudi said:
Thank you Fred!
I did the following on my form on a drop-down list Row source:
SELECT [Employee Details].NameID, [Employee Details].Names & " " &
[Employee
Details].Surname FROM [Employee Details];
I now refer to this drop-down list from within a query with:
[Forms]![Timesheet Report Selection]![Names]
Names is the name of the drop-down list object. What actually should
happen,
is that I must choose from the drop-down list a name (which is
concatenated
with the surname) and then use this value in a query to determine all the
records that has this name in a required field. The problem now is, that
that
query returns no values. If I use just a text box on the form and I type
the
name in manually, the query finds all the records. Any ideas what the
problem
might be? I can't see how there are any spaces added to the name/surname
which might have been the problem. Maybe I could add an asterix somewhere
to
eliminate the possibiliy of spaces?
Fred Boer said:
Dear Rudi:
The easiest way is not to do that!

If you do that you will be storing
redundant information unnecessarily. Whenever you might need a
"fullname",
simply concatenate the two together. For example: name&" "&surname,
would
give Fred Boer; surname&", "&name would give Boer, Fred.
By the way, you shouldn't use "name" as the name of a field. It is a
"reserved" word in Access and this will cause problems. You could use
something like "firstname" "midname" "surname", etc..
HTH
Fred Boer
Hi,
I have 2 fields in my table, name and surname. How do I append these 2
fields and store the result in a third field?
Thanks!