ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Value Property vs Text property (https://www.excelbanter.com/excel-programming/315147-value-property-vs-text-property.html)

augustus

Value Property vs Text property
 
Hi,

I got a spreadsheet with comboboxs connected to a database. Each combobox
basically load two columns of data: One for displying to user, another to be
store in database. However, everytime I save the spreadsheet, and load it up
again (when I can't finish the work), the Text property get changed to the
value in Value Property. WHY? Is there way to prevent this?
Running Win2000 & Office2003.

Thanks

Tom Ogilvy

Value Property vs Text property
 
for an activeX combobox, the value and text properties are identical. they
should always produce the same output.

--
Regards,
Tom Ogilvy

"augustus" wrote in message
...
Hi,

I got a spreadsheet with comboboxs connected to a database. Each combobox
basically load two columns of data: One for displying to user, another to

be
store in database. However, everytime I save the spreadsheet, and load it

up
again (when I can't finish the work), the Text property get changed to the
value in Value Property. WHY? Is there way to prevent this?
Running Win2000 & Office2003.

Thanks




augustus

Value Property vs Text property
 
Tom,
But why is it that we can specify them with different value initially?
Example,

Sheet1.cbxStructType.Clear
Sheet1.cbxStructType.BoundColumn = 1
Sheet1.cbxStructType.ColumnCount = 2
Sheet1.cbxStructType.ColumnWidths = "0;30"
Sheet1.cbxStructType.TextColumn = 2

Do While Not RS.EOF
Sheet1.cbxStructType.AddItem RS.Fields("StructID").Value
Sheet1.cbxStructType.List(Sheet1.cbxStructType.Lis tCount - 1, 1) =
RS.Fields("StructDescrip").Value
RS.MoveNext

Say Row 1, Column 1 = Me, and Column 2 = You
This will give me Value=Me, and Text=You

Even after I save the file, this will remain the same (I checked under
Design mode). However, the moment I close and reopen this book again, the
Text will change to Value.

Regards
Augustus

"Tom Ogilvy" wrote:

for an activeX combobox, the value and text properties are identical. they
should always produce the same output.

--
Regards,
Tom Ogilvy

"augustus" wrote in message
...
Hi,

I got a spreadsheet with comboboxs connected to a database. Each combobox
basically load two columns of data: One for displying to user, another to

be
store in database. However, everytime I save the spreadsheet, and load it

up
again (when I can't finish the work), the Text property get changed to the
value in Value Property. WHY? Is there way to prevent this?
Running Win2000 & Office2003.

Thanks





augustus

Value Property vs Text property
 
Sorry Tom, didn't mean to mislead you, I actually have setted them in design
mode, and not in code (the code was used initailly, 'cause I got few
comboboxes doing the same thing, but different database, they were then
changed to comment).

Regards
Augustus

"Tom Ogilvy" wrote:

You are correct (and I misspoke with reference to this specific situation).
the boundcolumn corresponds to the value property and the textcolumn
corresponds to the text property. However, if you are setting the
boundcolumn and textcolumn in code, then these settings are non-persistent.
Set them in design mode using the properties window and they should remain.

--
Regards,
Tom Ogilvy

"augustus" wrote in message
...
Tom,
But why is it that we can specify them with different value initially?
Example,

Sheet1.cbxStructType.Clear
Sheet1.cbxStructType.BoundColumn = 1
Sheet1.cbxStructType.ColumnCount = 2
Sheet1.cbxStructType.ColumnWidths = "0;30"
Sheet1.cbxStructType.TextColumn = 2

Do While Not RS.EOF
Sheet1.cbxStructType.AddItem RS.Fields("StructID").Value
Sheet1.cbxStructType.List(Sheet1.cbxStructType.Lis tCount - 1, 1) =
RS.Fields("StructDescrip").Value
RS.MoveNext

Say Row 1, Column 1 = Me, and Column 2 = You
This will give me Value=Me, and Text=You

Even after I save the file, this will remain the same (I checked under
Design mode). However, the moment I close and reopen this book again, the
Text will change to Value.

Regards
Augustus

"Tom Ogilvy" wrote:

for an activeX combobox, the value and text properties are identical.

they
should always produce the same output.

--
Regards,
Tom Ogilvy

"augustus" wrote in message
...
Hi,

I got a spreadsheet with comboboxs connected to a database. Each

combobox
basically load two columns of data: One for displying to user, another

to
be
store in database. However, everytime I save the spreadsheet, and load

it
up
again (when I can't finish the work), the Text property get changed to

the
value in Value Property. WHY? Is there way to prevent this?
Running Win2000 & Office2003.

Thanks








All times are GMT +1. The time now is 03:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com