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

Related questions

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

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.