×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

DropListBox option comes up as numeric value instead of String

DropListBox option comes up as numeric value instead of String

DropListBox option comes up as numeric value instead of String

(OP)
Can anyone explain why the selected string from a list is displayed as the number for which the string is found in the list? example: user selects "09:00", the value returned is 2, where "08:00" is at 0 in the list. I tried using real time values with a For/Next loop n an array, and it displayed as expected in the list, but came back displaying the the number in the list for which it is located,still. I want it to display the string selected, 09:00.

Any assistance would be appreciated. Thank you.

CODE

HOTD="08:00"&CHR$(9)&"08:30"&CHR$(9)&"09:00"&CHR$(9)&"09:30"&CHR$(9)&"10:00"&CHR$(9)& _

"10:30"&CHR$(9)&"11:00"&CHR$(9)&"11:30"&CHR$(9)&"12:00"&CHR$(9)&"12:30"&CHR$(9)& _

"13:00"&CHR$(9)&"13:30"&CHR$(9)&"14:00"&CHR$(9)&"14:30"&CHR$(9)&"15:30"&CHR$(9)& _

"16:00"&CHR$(9)&"16:30"&CHR$(9)&"17:00"'Hours of the day




    Begin Dialog dlgOptwo 88, 26, 193, 159, "This DIalog", .SMail

              ButtonGroup .ButtonPressed

       OkButton  128, 4, 50, 14, .btnOK

       CancelButton  128, 20, 50, 14, .btnCancel

       PushButton  130, 34, 44, 9, "&Reset"

       DropComboBox  6, 19, 73, 14, NameSelect(), .DCB1

       Text  6, 4, 73, 11, "Select REP"

       GroupBox  7, 44, 185, 76, "Group"

       TextBox  6, 142, 187, 15, .TB1

       Text  4, 129, 75, 10, "Additional Info:"

       TextBox  72, 51, 108, 15, .TB2

       Text  132, 74, 15, 9, "and"

       Text  72, 72, 26, 8, "between"

       DropListBox  102, 73, 27, 12, HOTD, .DLB1

       DropListBox  150, 75, 29, 13, HOTD, .DLB2

       DropComboBox  73, 97, 104, 14, "", .DCB2

       OptionGroup .OG1

          OptionButton  11, 71, 50, 8, "Option", .OB1

          OptionButton  11, 71, 50, 8, "Option", .OB2

          OptionButton  11, 96, 52, 8, "Option", .OB3

    End Dialog

It's always better to ask stupid questions; stupid questions have been known to reduce the frequency of stupid mistakes. clown

RE: DropListBox option comes up as numeric value instead of String




Hi,

I am not really sure how Extra DropDown control works, but I'd guess that it is returning the numeric position of the selection in a list.  So use the list to find the associated string.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: DropListBox option comes up as numeric value instead of String

(OP)
I'm sorry, I don't follow. Where would the list find the String? HOTD is a string, with several strings within it. I've tried using an array but got the same result.


CODE


HOTD(0)=" "
HOTD(1)="08:00"
HOTD(2)="09:00"
HOTD(3)="10:00"
HOTD(4)="11:00"
HOTD(5)="12:00"
HOTD(6)="13:00"
HOTD(7)="14:00"
HOTD(8)="15:00"
HOTD(9)="16:00"
HOTD(10)="17:00"


       '.....
       Text  132, 74, 15, 9, "and"

       Text  72, 72, 26, 8, "between"

       DropListBox  102, 73, 27, 12, HOTD(), .DLB1

       DropListBox  150, 75, 29, 13, HOTD(), .DLB2

       DropComboBox  73, 97, 104, 14, "", .DCB2
       '.....

                         ..time will tell!

It's always better to ask stupid questions; stupid questions have been known to reduce the frequency of stupid mistakes. clown

RE: DropListBox option comes up as numeric value instead of String

question. why not use dropcombobox instead of droplist?

otherwise you can use a select case

eg:

case is = "0" : t = 00:00
case is = "1" : t = 08:30

or something like that

 

RE: DropListBox option comes up as numeric value instead of String

(OP)
dropcombobox did the trick. Thank you Zak! What's the difference between the two?

It's always better to ask stupid questions; stupid questions have been known to reduce the frequency of stupid mistakes. clown

RE: DropListBox option comes up as numeric value instead of String

ted,

i wish i knew the difference between droplist vs dropcombo

glad it works now

zak

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close