Subform and combo box results

B

Beeyen

With the information below, I am trying to display the LastName and FirstName
of an employee table in a subform with the entries below but yet continue
result is the Last name only. Can you help?

Thanks

Row Source Type = Table/Query

Row Source = SELECT [Benefits Employee].LastName, [Benefits
Employee].FirstName, [Benefits Employee].EmployeeID FROM [Benefits Employee]
ORDER BY [Benefits Employee].LastName, [Benefits Employee].FirstName WITH
OWNERACCESS OPTION;

Column Count = 3

Column Heads = No

Column Widths = NA

Bound Column = 3
 
K

Ken Snell MVP

You want to see both the first and last names in the display area of the
combo box (you say subform, but RowSource indicates combobox or listbox)?
That cannot be done unless you concatenate the two fields' values into a
single string:

Row Source = SELECT [Benefits Employee].LastName & ", " & [Benefits
Employee].FirstName AS LFName, [Benefits Employee].EmployeeID FROM [Benefits
Employee] ORDER BY [Benefits Employee].LastName, [Benefits
Employee].FirstName WITH
OWNERACCESS OPTION;

Column Count = 2

Column Heads = No

Column Widths = 2";0"

Bound Column = 2
 
B

Beeyen

Good Day,

In reference to the RowSource, it is a combobox and the combobox is in a
subform. Your thoughts?

Ken Snell MVP said:
You want to see both the first and last names in the display area of the
combo box (you say subform, but RowSource indicates combobox or listbox)?
That cannot be done unless you concatenate the two fields' values into a
single string:

Row Source = SELECT [Benefits Employee].LastName & ", " & [Benefits
Employee].FirstName AS LFName, [Benefits Employee].EmployeeID FROM [Benefits
Employee] ORDER BY [Benefits Employee].LastName, [Benefits
Employee].FirstName WITH
OWNERACCESS OPTION;

Column Count = 2

Column Heads = No

Column Widths = 2";0"

Bound Column = 2

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/



Beeyen said:
With the information below, I am trying to display the LastName and
FirstName
of an employee table in a subform with the entries below but yet continue
result is the Last name only. Can you help?

Thanks

Row Source Type = Table/Query

Row Source = SELECT [Benefits Employee].LastName, [Benefits
Employee].FirstName, [Benefits Employee].EmployeeID FROM [Benefits
Employee]
ORDER BY [Benefits Employee].LastName, [Benefits Employee].FirstName WITH
OWNERACCESS OPTION;

Column Count = 3

Column Heads = No

Column Widths = NA

Bound Column = 3
 
K

Ken Snell MVP

My thoughts about what? I posted a suggested change to your query, but you
didn't comment about whether that was headed in the right direction, or how
I may have misunderstood your question. Please provide more details and
explanation.
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Beeyen said:
Good Day,

In reference to the RowSource, it is a combobox and the combobox is in a
subform. Your thoughts?

Ken Snell MVP said:
You want to see both the first and last names in the display area of the
combo box (you say subform, but RowSource indicates combobox or listbox)?
That cannot be done unless you concatenate the two fields' values into a
single string:

Row Source = SELECT [Benefits Employee].LastName & ", " & [Benefits
Employee].FirstName AS LFName, [Benefits Employee].EmployeeID FROM
[Benefits
Employee] ORDER BY [Benefits Employee].LastName, [Benefits
Employee].FirstName WITH
OWNERACCESS OPTION;

Column Count = 2

Column Heads = No

Column Widths = 2";0"

Bound Column = 2

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/



Beeyen said:
With the information below, I am trying to display the LastName and
FirstName
of an employee table in a subform with the entries below but yet
continue
result is the Last name only. Can you help?

Thanks

Row Source Type = Table/Query

Row Source = SELECT [Benefits Employee].LastName, [Benefits
Employee].FirstName, [Benefits Employee].EmployeeID FROM [Benefits
Employee]
ORDER BY [Benefits Employee].LastName, [Benefits Employee].FirstName
WITH
OWNERACCESS OPTION;

Column Count = 3

Column Heads = No

Column Widths = NA

Bound Column = 3
 
B

Beeyen

Good Day,

I created a table called Benefits Employee which has the fields LastName,
FirstName, Position, etc. I then created a form that allows me to enter the
information requested LastName, FirstName, etc.

I created a combo box in a subform, and entered the properties I provided
earlier, so that others can select there name from a drop down.

As you mentioned; I want to see both the first and last names in the display
area of the combo box (you say subform, but RowSource indicates combobox or
listbox)? That is correct and it is a combobox. You say ‘that cannot be done
unless you concatenate the two fields' values into a single string’.
I entered the information you provided. When I click on the drop-down, I
receive a message ‘The invalid bracketing of name Benefits Employee’.

Any suggestion from here?

Ken Snell MVP said:
My thoughts about what? I posted a suggested change to your query, but you
didn't comment about whether that was headed in the right direction, or how
I may have misunderstood your question. Please provide more details and
explanation.
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Beeyen said:
Good Day,

In reference to the RowSource, it is a combobox and the combobox is in a
subform. Your thoughts?

Ken Snell MVP said:
You want to see both the first and last names in the display area of the
combo box (you say subform, but RowSource indicates combobox or listbox)?
That cannot be done unless you concatenate the two fields' values into a
single string:

Row Source = SELECT [Benefits Employee].LastName & ", " & [Benefits
Employee].FirstName AS LFName, [Benefits Employee].EmployeeID FROM
[Benefits
Employee] ORDER BY [Benefits Employee].LastName, [Benefits
Employee].FirstName WITH
OWNERACCESS OPTION;

Column Count = 2

Column Heads = No

Column Widths = 2";0"

Bound Column = 2

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/



With the information below, I am trying to display the LastName and
FirstName
of an employee table in a subform with the entries below but yet
continue
result is the Last name only. Can you help?

Thanks

Row Source Type = Table/Query

Row Source = SELECT [Benefits Employee].LastName, [Benefits
Employee].FirstName, [Benefits Employee].EmployeeID FROM [Benefits
Employee]
ORDER BY [Benefits Employee].LastName, [Benefits Employee].FirstName
WITH
OWNERACCESS OPTION;

Column Count = 3

Column Heads = No

Column Widths = NA

Bound Column = 3
 
K

Ken Snell MVP

Likely you were "bit" by the wrapping of my reply in the news reader. The
full SQL statement that I posted should be one line. Copy the lines from the
post, paste them into a Notepad file, get rid of any line feeds so that the
text is all on one line, then copy and paste that line into your combo box's
RowSource property.
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/



Beeyen said:
Good Day,

I created a table called Benefits Employee which has the fields LastName,
FirstName, Position, etc. I then created a form that allows me to enter
the
information requested LastName, FirstName, etc.

I created a combo box in a subform, and entered the properties I provided
earlier, so that others can select there name from a drop down.

As you mentioned; I want to see both the first and last names in the
display
area of the combo box (you say subform, but RowSource indicates combobox
or
listbox)? That is correct and it is a combobox. You say 'that cannot be
done
unless you concatenate the two fields' values into a single string'.
I entered the information you provided. When I click on the drop-down, I
receive a message 'The invalid bracketing of name Benefits Employee'.

Any suggestion from here?

Ken Snell MVP said:
My thoughts about what? I posted a suggested change to your query, but
you
didn't comment about whether that was headed in the right direction, or
how
I may have misunderstood your question. Please provide more details and
explanation.
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Beeyen said:
Good Day,

In reference to the RowSource, it is a combobox and the combobox is in
a
subform. Your thoughts?

:

You want to see both the first and last names in the display area of
the
combo box (you say subform, but RowSource indicates combobox or
listbox)?
That cannot be done unless you concatenate the two fields' values into
a
single string:

Row Source = SELECT [Benefits Employee].LastName & ", " & [Benefits
Employee].FirstName AS LFName, [Benefits Employee].EmployeeID FROM
[Benefits
Employee] ORDER BY [Benefits Employee].LastName, [Benefits
Employee].FirstName WITH
OWNERACCESS OPTION;

Column Count = 2

Column Heads = No

Column Widths = 2";0"

Bound Column = 2

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/



With the information below, I am trying to display the LastName and
FirstName
of an employee table in a subform with the entries below but yet
continue
result is the Last name only. Can you help?

Thanks

Row Source Type = Table/Query

Row Source = SELECT [Benefits Employee].LastName, [Benefits
Employee].FirstName, [Benefits Employee].EmployeeID FROM [Benefits
Employee]
ORDER BY [Benefits Employee].LastName, [Benefits Employee].FirstName
WITH
OWNERACCESS OPTION;

Column Count = 3

Column Heads = No

Column Widths = NA

Bound Column = 3
 
B

Beeyen

At Last, It works.

Thanks and for the continued response.

Ken Snell MVP said:
You want to see both the first and last names in the display area of the
combo box (you say subform, but RowSource indicates combobox or listbox)?
That cannot be done unless you concatenate the two fields' values into a
single string:

Row Source = SELECT [Benefits Employee].LastName & ", " & [Benefits
Employee].FirstName AS LFName, [Benefits Employee].EmployeeID FROM [Benefits
Employee] ORDER BY [Benefits Employee].LastName, [Benefits
Employee].FirstName WITH
OWNERACCESS OPTION;

Column Count = 2

Column Heads = No

Column Widths = 2";0"

Bound Column = 2

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/



Beeyen said:
With the information below, I am trying to display the LastName and
FirstName
of an employee table in a subform with the entries below but yet continue
result is the Last name only. Can you help?

Thanks

Row Source Type = Table/Query

Row Source = SELECT [Benefits Employee].LastName, [Benefits
Employee].FirstName, [Benefits Employee].EmployeeID FROM [Benefits
Employee]
ORDER BY [Benefits Employee].LastName, [Benefits Employee].FirstName WITH
OWNERACCESS OPTION;

Column Count = 3

Column Heads = No

Column Widths = NA

Bound Column = 3
 

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