Merging Number and Text Field in Combobox

E

Elvis72

I have a subform that has a combobox with the following rowsource:

SELECT TblStaffRequirements[Title ID] & " - " & [Position Title] AS FullName
FROM TblStaffRequirements;

But the Title ID is an Autonumber and the Position Title is a Text field so
I am getting an error.

There has to be a way to show them both on the combobox on selection.

I have to have the Title ID on the Combobox as without it I cannot create a
new record on the Combobox.

Thanks for your help!~
 
D

Dennis

Your problem is you are missing the dot operator before [Title ID]. You have
not got the table name before the [Position Title] field so why have it
before the [Title ID]

SELECT [Title ID] & " - " & [Position Title] AS FullName FROM
TblStaffRequirements;
 
E

Elvis72

Dennis -

I see your point I had previously updated my statement to read:

SELECT [Title ID] & " - " & [Position Title] AS FullName FROM
TblStaffRequirements;

But it gave me the same error so I tried:

SELECT [Title ID], [Position Title] & " - " & [Title ID] AS FullName FROM
TblStaffRequirements;

But it gave me only the Title ID number in the combobox.

So, I tried your statements which gave me the following message:

Characters found after end of SQL Statement?






Dennis said:
Your problem is you are missing the dot operator before [Title ID]. You have
not got the table name before the [Position Title] field so why have it
before the [Title ID]

SELECT [Title ID] & " - " & [Position Title] AS FullName FROM
TblStaffRequirements;

Elvis72 said:
I have a subform that has a combobox with the following rowsource:

SELECT TblStaffRequirements[Title ID] & " - " & [Position Title] AS FullName
FROM TblStaffRequirements;

But the Title ID is an Autonumber and the Position Title is a Text field so
I am getting an error.

There has to be a way to show them both on the combobox on selection.

I have to have the Title ID on the Combobox as without it I cannot create a
new record on the Combobox.

Thanks for your help!~
 
D

Dennis

I don't know what your specific problem is but it is not that you cannot have
a numeric and text field combined in a combobox because I have tested it with
one of my tables. Go to the end of your SQL statement and press the delete
key several times to see if there are residual characters in your statement.

Elvis72 said:
Dennis -

I see your point I had previously updated my statement to read:

SELECT [Title ID] & " - " & [Position Title] AS FullName FROM
TblStaffRequirements;

But it gave me the same error so I tried:

SELECT [Title ID], [Position Title] & " - " & [Title ID] AS FullName FROM
TblStaffRequirements;

But it gave me only the Title ID number in the combobox.

So, I tried your statements which gave me the following message:

Characters found after end of SQL Statement?






Dennis said:
Your problem is you are missing the dot operator before [Title ID]. You have
not got the table name before the [Position Title] field so why have it
before the [Title ID]

SELECT [Title ID] & " - " & [Position Title] AS FullName FROM
TblStaffRequirements;

Elvis72 said:
I have a subform that has a combobox with the following rowsource:

SELECT TblStaffRequirements[Title ID] & " - " & [Position Title] AS FullName
FROM TblStaffRequirements;

But the Title ID is an Autonumber and the Position Title is a Text field so
I am getting an error.

There has to be a way to show them both on the combobox on selection.

I have to have the Title ID on the Combobox as without it I cannot create a
new record on the Combobox.

Thanks for your help!~
 
E

Elvis72

All righty...I think we have struck gold!~

Here is the statement:

SELECT [Title ID], [Title ID] & " - " & [Position Title] AS FullName FROM
TblStaffRequirements;

Bound Column set to 1
Column Count 2
Column Widths 0 and 1

Now I have another issue all together which I will post under another
heading!~

Thanks sooo much for all your help!~

Dennis said:
I don't know what your specific problem is but it is not that you cannot have
a numeric and text field combined in a combobox because I have tested it with
one of my tables. Go to the end of your SQL statement and press the delete
key several times to see if there are residual characters in your statement.

Elvis72 said:
Dennis -

I see your point I had previously updated my statement to read:

SELECT [Title ID] & " - " & [Position Title] AS FullName FROM
TblStaffRequirements;

But it gave me the same error so I tried:

SELECT [Title ID], [Position Title] & " - " & [Title ID] AS FullName FROM
TblStaffRequirements;

But it gave me only the Title ID number in the combobox.

So, I tried your statements which gave me the following message:

Characters found after end of SQL Statement?






Dennis said:
Your problem is you are missing the dot operator before [Title ID]. You have
not got the table name before the [Position Title] field so why have it
before the [Title ID]

SELECT [Title ID] & " - " & [Position Title] AS FullName FROM
TblStaffRequirements;

:

I have a subform that has a combobox with the following rowsource:

SELECT TblStaffRequirements[Title ID] & " - " & [Position Title] AS FullName
FROM TblStaffRequirements;

But the Title ID is an Autonumber and the Position Title is a Text field so
I am getting an error.

There has to be a way to show them both on the combobox on selection.

I have to have the Title ID on the Combobox as without it I cannot create a
new record on the Combobox.

Thanks for your help!~
 

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