Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need help on macro to get specific field selected value on the multibox. Can anyone help me on this.
Hi XXX
If your MultiBox has expressions, I don't think this is possible. If you have fields, you can make selection to the fields in the multibox, you are interested in.
EDIT:
On second thought, it seems this macro from APIGuide can help you:
Sub GetSelected
x=ActiveDocument.GetSheetObject("MB01").GetRelevantSelections
for i = lbound(x) to ubound(x)
msgbox(x(i))
next
Hi XXX
If your MultiBox has expressions, I don't think this is possible. If you have fields, you can make selection to the fields in the multibox, you are interested in.
EDIT:
On second thought, it seems this macro from APIGuide can help you:
Sub GetSelected
x=ActiveDocument.GetSheetObject("MB01").GetRelevantSelections
for i = lbound(x) to ubound(x)
msgbox(x(i))
next
Hi Rakesh,
Thanks for your response.
The macro will return the Database field name and the value. Also output value is not the string type.
Try this for just value portion:
Sub GetS
x=ActiveDocument.GetSheetObject("MB01").GetRelevantSelections
for i = lbound(x) to ubound(x)
msgbox(trim(mid(x(i), instr(x(i), chr(9))+1, 100)))
next
End Sub
Please note that there is a TAB between field name and value in the return array.
I have hard coded 100 for the value field length, but you may also use len() or some other function to be precise.
Thanks Rakesh,
This is what i have done and it is working for me perfectly
Sub GetSelected()
x=ActiveDocument.GetSheetObject("MB03").GetRelevantSelections
Cname=x(0)
Cstr(Cname)
id=Right(Cstr(Cname),len(Cstr(Cname))-12)
msgbox(id)
End Sub