Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List box bound column not changing? 1

Status
Not open for further replies.

EMJULIAN

Programmer
Aug 14, 2002
45
US
I have a form with 4 pageframes. On page 2 there is a drop down list box that has 2 columns, only one is visible. When the user selects the item from the list, I populate fields in a table with the information from both columns by changing the bound column and doing a replace in the table with the value from the list box. However, it only seems to change the bound column if I set a breakpoint at the "this...boundcolum=2" line. If I don't break, it puts the info from col. 1 into both fields. The thing that is really killing me is that I have the exact same box with the exact same code on page 1 of the form and it works just fine. What is going on????

Thanks,
Eve
 
Eve,
How is the combobox defined? What is the RowSourceType and RowSource? What is the Style property? Is there ControlSource (what is it)? Are you changing this combox's bound column? What are the data types of the two columns?

Rick
 
Rick,
The list is built in the INIT of the combobox, from fields in a table (Col 1=eventlis.list_descrtn and Col 2 = eventlis.list_name)

RowSourceType=0
RowSource=none
Style=2-dropdown list
Control Source=reccom.list_name (field in a table)
Data type of both columns is character

In the click event the code for storing the info from the 2 columns is:

thisform...cmbevntlist.boundcolumn=2
repl reccom.list_name with thisform....cmbevntlist.value
thisform...cmbevntlist.boundcolumn=1
repl reccom.list_descrtn with thisform...cmbevntlist.value

This works correctly only if I put a breakpoint in the 1st 2 lines of code. If not, both fields are populated with the list_descrtn that is in column 1.

Thanks,
Eve
 
Eve,
Have you tried adding a thisform...cmbevntlist.refresh() after each change of the boundcolumn property?

Actually I think you could avoid this problem (and not potentially mess up your ControlSource=reccom.list_name), by simply leaving the boundcolumn at 2 and using this code:
Code:
[green]* don't change from 2 - thisform...cmbevntlist.boundcolumn=2[/green]
repl reccom.list_name with thisform....cmbevntlist.value
[green]* eliminate - thisform...cmbevntlist.boundcolumn=1[/green]
repl reccom.list_descrtn with thisform...cmbevntlist.[red][b]Display[/b][/red]value
Rick
 
Rick,

Thanks, leaving the bound column and using value and display value worked perfectly.

Thanks!
Eve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top