Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DocumentVariable class confusion

Status
Not open for further replies.

mortac8

Programmer
Jun 7, 2001
12
US
I have a query that displays some data including a sorted email address column. When I use the DocumentVariable class however, my Email Addr column is no longer sorted. The data appears to be almost randomly accessed and entered into my array(below). How can I make my DocumentVariable class access the data exactly as it appears in my BO table?



Dim resultlist As String
Dim vars As DocumentVariables
Dim var As DocumentVariable
Dim doc As Document
Set doc = ThisDocument
Set vars = doc.DocumentVariables
Dim i As Integer
Dim myarr As Variant
Dim arr_size As Integer


Dim k


'Number of total variables including names and cells
For i = 1 To vars.Count

Set var = vars.Item(i)

If var.Name = "Email Addr" Then

arr_size = UBound(var.Values(BoAllValues))
myarr = var.Values(BoAllValues)

For k = 1 To arr_size
resultlist = resultlist & myarr(k) & Chr(10)
Next k
 
You can sort the query (query panel) by the address object (ascending or descending). This does not influence the sortings of your report (tables, sections, etc.).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top