Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a listbox which displays items created by and expression (not a field).
How can I select an item in the listbox via code?
From the QV API Guide:
ActiveDocument.Fields("Month").Select "September"
ActiveDocument.Fields("Month").Select "J*"
ActiveDocument.Fields("Sales").Select ">1500"
Simply wrap in a Sub as normal.
Hope that solves it,
Matt - Visual Analytics Ltd
The listbox is displaying the results of an expression, not a field.
Michael, maybe this can help.
This Macro makes a selection in a listbox that is based on a expression. The expression results in one row and the macro selects this row. If there is no row in the listbox, a messages is thrown.
sub SelectInListBox
set ListBoxRows = ActiveDocument.GetSheetObject( "LB02" )
IF ListBoxRows.GetRowCount = 1 THEN
set lb = activedocument.getsheetobject("LB02")
lb.selectpossible
ELSE
msgbox("Adjust your Filters to match customers")
end if
end sub
br
paul