Skip to Content
author's profile photo Former Member
Former Member

Set a combo box value in a matrix

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2005 at 12:08 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Avi

      I just tried your suggestion and I am getting a message ref the item is not a user defined item and cannot be handled in such a manner

      I forgot to say I am working on the detail matrix in a sales order

      Any ideas please ?

      Regards Andy

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2005 at 01:45 PM

    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
    10|10000 characters needed characters exceeded

    • Hi,

      First I will suggest you to read about formatted searches. They are very usefull, and give lot of possibilities spending very few time and without coding anything (just a sql query).

      You can find information about how they work on the SMB portal, under Service & SupportKnowledge & ServicesKnowledge BaseCustomizingFormatted Search.

      Then when you know what tools you can use, select the one that best fits your needs.

      Following your problem, I dont think that containing more than one occurence of the same stock code is a problem for formatted searches. Not in 6.5, neither in 2004.

      The only limitation is that in a matrix you can not use lines appart from the current or the first.

      Regards,

      Ibai Peñ

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.