473,322 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

how can you get 2 datafields displayed in a combo box?

How can you get 2 datafields displayed in a combo box, and still return just
one of the fields?

I need to return a company name in order to help users visually determine
who a rep works for, but need only the repcode to pass on to another
variable.

SC

Nov 18 '05 #1
3 1131
Set the DataTextField and the DataValueField properties of the DropDownList
control to the column names of the corresponding columns. If you have the
MSDN Library installed there are examples in the topics for these
properties.

Hope this helps
Martin
<me@privacy.net> wrote in message
news:u5*************@tk2msftngp13.phx.gbl...
How can you get 2 datafields displayed in a combo box, and still return just one of the fields?

I need to return a company name in order to help users visually determine
who a rep works for, but need only the repcode to pass on to another
variable.

SC

Nov 18 '05 #2
Martin - thanks for the response -

A follow-up question -

If I am in my select statement formatting the first of the 2 fields, for
example:

select
'(' + company + ')' as company1,
salesrepname as Salesrepname

would I need to put in the field only (company), or the result of the AS
(company1) or would it be the string formatted '('+company+')'?

Thanks,

SC

"Martin Dechev" <de*******@hotmail.com> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
Set the DataTextField and the DataValueField properties of the DropDownList control to the column names of the corresponding columns. If you have the
MSDN Library installed there are examples in the topics for these
properties.

Hope this helps
Martin
<me@privacy.net> wrote in message
news:u5*************@tk2msftngp13.phx.gbl...
How can you get 2 datafields displayed in a combo box, and still return

just
one of the fields?

I need to return a company name in order to help users visually determine who a rep works for, but need only the repcode to pass on to another
variable.

SC


Nov 18 '05 #3
The column name will be what you specify with the AS clause, in your example
the table in the dataset should have columns with names "company1" and
"Salesrepname". The same if it is DataReader.

Hope this helps
Martin
<me@privacy.net> wrote in message
news:ut**************@TK2MSFTNGP12.phx.gbl...
Martin - thanks for the response -

A follow-up question -

If I am in my select statement formatting the first of the 2 fields, for
example:

select
'(' + company + ')' as company1,
salesrepname as Salesrepname

would I need to put in the field only (company), or the result of the AS
(company1) or would it be the string formatted '('+company+')'?

Thanks,

SC

"Martin Dechev" <de*******@hotmail.com> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
Set the DataTextField and the DataValueField properties of the

DropDownList
control to the column names of the corresponding columns. If you have the
MSDN Library installed there are examples in the topics for these
properties.

Hope this helps
Martin
<me@privacy.net> wrote in message
news:u5*************@tk2msftngp13.phx.gbl...
How can you get 2 datafields displayed in a combo box, and still
return just
one of the fields?

I need to return a company name in order to help users visually

determine who a rep works for, but need only the repcode to pass on to another
variable.

SC



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: | last post by:
How can you get 2 datafields displayed in a combo box, and still return just one of the fields? I need to return a company name in order to help users visually determine who a rep works for, but...
6
by: | last post by:
How can you get 2 datafields displayed in a combo box, and still return just one of the fields? I need to return a company name in order to help users visually determine who a rep works for, but...
0
by: | last post by:
How can you get 2 datafields displayed in a combo box, and still return just one of the fields? I need to return a company name in order to help users visually determine who a rep works for, but...
10
by: truptivk | last post by:
Hello all, I have a situation and I'd appreciate it if any of you could help me. I am not sure if this is js or html but here goes. I have a main combo box (mcb) which I'm displaying some values....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.