It seemed easy enough when I was writing the proposal.
Open a query and spill the results and field names to an Array. Then open Excel and write the results to specific “named fields” that have the same name as the Array field names.
Anybody got any code that would get me started? I stole the following from my predecessor.
Thanks!
Alan
Open a query and spill the results and field names to an Array. Then open Excel and write the results to specific “named fields” that have the same name as the Array field names.
Anybody got any code that would get me started? I stole the following from my predecessor.
Code:
Call SetKeyValue("ReviewID", Me.investment_review_ID.Value)
Set rstObj = CurrentDb.OpenRecordset("qryInvestReviewExport")
' Gets data from qryInvestReviewExport in anticipation of writing to Review xlsx
If (Not rstObj.EOF) Then
For Each rstFld In rstObj.Fields
If (Not IsNull(rstFld.Value)) Then [COLOR=red]'blows up here[/color]
Set formSQLitem = formSQLdata.Item(rstFld.name)
Let formSQLitem.formValue = rstFld.Value
End If
Debug.Print rstFld.name & Chr(32) & rstFld.Value '06/23
Next rstFld
Call rstObj.MoveNext
End If
Call rstObj.Close
Set rstObj = Nothing
Alan