Greg,
From your post # 9 "The code never physically opens Excel to search."
Just dropped in from boredom, and your name caught my eye.
It seems to me that not opening Excel in the background memory is really making this more difficult. I would layout the data like Paul did in #8, but with an added empty column between each record. I would open objExcel in Word. Then I would use a Worksheet function to return the Record's Range Address to the SQLQuery in Word.
Word Code:Sheet Code:strMyVar = objExcel.Worksheet_Object_Name.GetRecordAddress occIDOf course if you don't use an empty column separator, then you will have to Set tmp using Offsets and Ends.Public Function GetRecordAddress(occID As Variant) As String 'Returns an address or null Dim tmp as Range Set tmp = Row(n).Find(Cstr(occID)) If Not tmp is Nothing Then GetRecordAddress = tmp.CurrentRegion.Address End Function
Personally, I would make the Worksheet a custom Object with Properties and Methods which Properties would return values as needed
Word Code:Putting a For Each Item in MyDoc around the With Structure lets you loop thru all Controls, AND, ignores any orphan records in the worksheet.Set myDB = 'Open the Custom Excel WorksheetObject With myDB .Record = occID myocc.Name = .Name myocc.Label = .label etc End With Etc