Saving backcolor and text

Now that I have some code working that is saving the backcolor of a textfield, how do I also save text to the same textfield as well, this is the code I am using to save the backcolor.

This code is in the change event of the combobox :

[code] Dim d As new dictionary
d.value(“Mens”) = &cFF00FF 'RGB(255,0,255)

Dim myColor As string = combobox1.Text
if d.hasKey(myColor) Then
test1.backcolor = d.value(myColor)
test2.backcolor = d.value(myColor)
end if[/code]

This is the method I came up with to save the backcolor:

[code]dim mycolor as string
mycolor = Str(Test1.backcolor)
dim dr as New DatabaseRecord
dim rs as RecordSet

if golfer <> nil then
rs = golfer.SQLSelect("select * from test where PK = "+ str(testpk))

end if

dr.column(“test1”) = (mycolor)
app.golfer.InsertRecord “test”, dr

app.golfer.commit

msgbox"New Record Added"[/code]

I have tried a couple of things but it always saves the the text to a new row in the database.

Do you have separate fields for color and text in the table?

dr.column("test1color") = mycolor
dr.column("test1text") = test1.text
app.golfer.InsertRecord "test", dr

Thanks Tim, forgot the sepperate columns , now what about when it comes to pulling the backcolor and text back out of the database and applying both details to the textfield.

My normal way of doing it would be:

dim rs as recordset = app.golfer.SQLSelect("select * from test where PK = "+ str(testpk)) test1.text = DefineEncoding(rs.Field("test1text").stringvalue, encodings.UTF8) test2.text = DefineEncoding(rs.Field("test2text").stringvalue, encodings.UTF8) rs.Close

How would I need to alter this.

Thanks Shane

have added the following line

test1.text = me.backcolor  (rs.Field("test1color").stringvalue)

But tells me it is not an array, I don’t uderstand