Link to home
Create AccountLog in
Avatar of stanmurphy
stanmurphy

asked on

Combobox confusion

Hi Experts,

I'm trying to populate a combobox with two fields from one table and then save a value to another table.

ControlSource=Table2.Field1
RowsourceType = 6 (Fields)
Rowsource = Table1.Field1,Field2
BoundColumn=2
BoundTo = .T. (I've also tried .F.)
ColumnCount=2
ColumnWidths=0,125
Style = 2 - Dropdown List


The Rowsource table is just an index field and a description, both character fields.


Rowsource Table

Field1       Field2

01            Choice1
02            Choice2
03            Choice3
04            Choice4


I want the combobox to display Table1.Field2 and when a selection is made I want to store Table1.Field1 to Table 2.

What's happening is that nothing initially displays in the combobox. When I click on it, I see the items from Table1.Field2, as I should. But when I click on an item, I see the value from Table1.Field2. That is the value I want to store in Table 2, but I don't want to display it in the combobox after I make a selection.

For instance, when I click on the combobox I see Choice1, Choice2, etc. But when I select one of them, I see 01, 02, etc., which is what I want to store in Table 2, but not display in the combobox.

If it makes a difference, both tables are buffered,3.

I've tried using the Builder, with the same results. Any ideas? I've been at this for two days now.
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of stanmurphy
stanmurphy

ASKER

I was hoping I was just missing some setting in the combobox, but I think I knew I'd have to use some code somewhere.

Thank you very much!!