Good afternoon,
Can someone please tell me how I can return records from a query. I have text fields that I need to obtain, and have those necessary records sent to MS Word. I need to return the data that is in MainSectionLabe l, MainLabel and SummaryTextBox.
Here is what I have so far:
Can someone please tell me how I can return records from a query. I have text fields that I need to obtain, and have those necessary records sent to MS Word. I need to return the data that is in MainSectionLabe l, MainLabel and SummaryTextBox.
Here is what I have so far:
Code:
Public Function gettbldata()
Dim strSQL As String
Set objRecordset = CreateObject("ADODB.recordset")
strSQL = "SELECT SSR2_Table.ID, SSR2_Table.DataReportID, " & _
"SSR2_Table.MainSectionID, SSR2_Table.MainSectionLabel, " & _
"SSR2_Table.MainLabel, SSR2_Table.SummaryTextBox, " & _
"SSR2_Table.[Month/Year]" & _
"FROM (SSR_DataReportName INNER JOIN SSR_DataReportLabels " & _
" ON SSR_DataReportName.[DataReport ID] = SSR_DataReportLabels.DataReportID) " & _
" INNER JOIN SSR2_Table " & _
" ON SSR_DataReportLabels.DataReportID = SSR2_Table.DataReportID" & _
"WHERE (((SSR2_Table.DataReportID)=1));"
End Function
Comment