Ack. First, please don't post using HTML. Use Plain Text, please.
Second, if your "Code" is as simple as "A", "B", "C", etc. then you could
get the ASCII value (which is numeric) and store that in ItemData. Then,
use Chr$() to get it back to the character. This would be a best-case
scenario.
Other than that, your only other option (that I know of) is to create a
parallel array and keep that array in sync with the combobox. IOW, the
array elements would store the Code and the array's indexes would correspond
to the combobox's indexes for items.
Utimately, this all boils down to a database design issue. I assume Code is
a primary key. It's really rather rare that a primary key should be a text
field because it's common and convenient to store a primary key in ItemData
(for obvious reasons). If you can change the Code field in the database to
be numeric, I think you'd be much better off. But, sometimes, you have to
work with what you've got; perhaps because making such a change to the table
would mean re-writing a lot of code. But even if you did need to re-write a
fair amount of code, it might be worth it. Only you (maybe with a DBA's
assistance) can determine that.
Mike
Hello everyone,
I have some tables in a jet database that I would like to use to populate
some combobox controls in my application, but the tables contain a single
character index and a description, rather than a numeric index. This
presents a problem since .itemdata only supports numeric information about
list items. One of my tables might look like:
Code Desc
A Alpha
B Beta
C Charlie
Does anyone have any ideas as to how I might make both populating the
combobox and updating from/storing to the database work? All of the example
code I can find assumes you have a numeric index to work with.
Any and all help is appreciated!
Thanks in advance,
JJ
JJ - 31 Aug 2004 03:52 GMT
I use Outlook Express for newsgroups, and I have no idea why but
occasionally it decides it wants to post in Rich Text mode even though it's
set to plain text. You have my apologies. I need to get a better newsgroup
app. :)
Yeah, I thought about changing the primary key to be numeric, but my program
imports the tables from a program I don't control, and exports data back to
that same program. If I change or add a key, I'll have to reconvert it
again for the export. I must admit, I hadn't thought of using the ASCII
value of the key. That may be the way to go in my particular situation.
Thank you very much for the advice.
-JJ
> Ack. First, please don't post using HTML. Use Plain Text, please.
>
[quoted text clipped - 49 lines]
> Thanks in advance,
> JJ
MikeD - 31 Aug 2004 04:54 GMT
> I use Outlook Express for newsgroups, and I have no idea why but
> occasionally it decides it wants to post in Rich Text mode even though it's
> set to plain text. You have my apologies. I need to get a better newsgroup
> app. :)
I use OE. Never had any problems in regards to plain text vs. HTML.
Personally, I think OE is a very good newsreader. You just need to learn
how to use it to your liking (no different than any other program).
You might want to check your configuration. Make sure you've set plain text
for newsgroups (it's a separate setting from email). Also, I recommend
unchecking the setting to reply using the same format as the original
message (when you're composing the message, you can always change the
format). This way, if you specify plain text for newsgroups, you're always
going to send plain text by default. These settings are all on the Send tab
of Options.
Mike