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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

combo box changing data

Status
Not open for further replies.

fishman13

Programmer
Jul 8, 2002
73
US
I have a form that I use to display the fields of a table. When I enter the form or change the repord pointer, I set the value of the controls to the value stored in the current reocrd. On of the controls is a combo box that is filled by a select from another table. The problem I have is when I do a search I set all the values to a blank (control.value=""). When I do this the value stored in the table is removed. (This only happens with the combo boxes filled by a select, the addlistitems combos work fine). I have tried to set the bound to both Y and N, still happens. I am currenlty working around this problem by setting the foreground color = background color and preventing the user from entering them. Why does clearing the control value change the value stored in the table records?

Thanks
 
Do you have the ControlSource set to the table field? If you blank it, it will also remove data fom the table. Are you using Value or DisplayValue to update the table?
Dave S.
[cheers]
 
Dave,

The control Source is set to none and I am setting the value property

 
Fishman:

You say this only happens when you specify select (3-SQL) as recordsourcetype. Is that correct? If so, your cursor is read-only. Even if you change the text that is displayed in the textbox portion of the combobox, the actual value in the cursor (and the list portion) stays the same.

If you are actually changing your table field values via the combobox, the controlsource (rowsource) has to be that table.

Is there any more to your form that may be causing this?

Al
 
Al,

I am using the base form and combo box with nothing controling the data. In the init function of the form I set thisform.cb_zip.vale = locat.zipcode. When I do a search I clear the fields by using thisform.cb_zip.vale = "", and this removes the data from the record. If I comment this line out the data is not changed.
 
Thanks for you help guys. I found in my combo box I was setting the controlsource to my zipcode table
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top