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

Error getting UDF value

Hi,

I'm trying to get the values from some standard fields and some UDFs on the Sales Order form

Everything works fine for the standard fields but I get an error on the UDFs

Here's my code

'This bit works fine

Set oForm = SBO_Application.Forms.Item(FormUID)

Set oItem = oForm.Items.Item("8")

Set oEditText = oItem.Specific

strDocNum = oEditText.String

'This bit doesn't work

Set oForm = SBO_Application.Forms.GetFormByTypeAndCount(-139, 1)

Set oItem = oForm.Items("U_CrPrj")

'The next line causes a type mismatch error????

Set oEditText = oItem.Specific

strDocNum = oEditText.String

Anyone out there have any idea where I'm goin wrong?

Thanks

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 04, 2004 at 10:42 AM

    Hi

    Probably, oForm.Items("U_CrPrj") is not an EditText item.

    You can get type of the object using VBA.TypeName function.

    Something like this:

    Set oItem = oForm.Items("U_CrPrj")

    Debug.Print TypeName(oItem.Specific)

    Result will be printed in the immediate window.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 04, 2004 at 11:10 AM

    That was exactly the problem!

    Cheers, thanks for that

    Add comment
    10|10000 characters needed characters exceeded