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
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