Hi
I am updating a matrix and some of the columns are combo box's. I can set the value of these with code like the following -
Set ocombo = omatrix.Columns("U_Type").Cells(Val.Row).Specific
ocombo.Select "2", psk_ByValue
I would like to set these via a user defined data source as it seems much more reliable and doesn't seem to fire off a load of events
Does anyone know how to do this please ?
Regards Andy
Hi,
You are right, it will be much better in performence terms do use UserDataSource instead of firing oee a lot of UI events
you can do it as follows:
'Define UserDataSource
oForm.DataSources.UserDataSources.Add "Type", dt_SHORT_TEXT
'bind the column to sn User Data Source
oMatrix.Columns("U_Type").DataBind.SetBound True, "", "Type"
'====================================
oMatrix.GetLineData Val.Row
oForm.DataSources.UserDataSources.Item("Type").Value = "2" 'set the VALUE (not the description) of the required valid value
'Note, since version 2004, you should use 'ValueEx' instead of 'Value'
oMatrix.SetLineData Val.Row
Regarda, Avi.
Hello Andy,
Unfortunatly, system matrixes do not support all the methods that are supported by user matrix (GetLineData, SetLineData is just an example)
is the determination of the value in the combobox derived from other values in the row or header?
did you consider to use formatted search in order to set the combo selection?
Regards, Avi.
Add a comment