Error 3270 - Property Not Found

R

Robert Brown

I have this routine which changes the source for my crosstab query

Sub ChangeXTab()

Dim strSql As String
Dim strCategory As String, strLocation As String

strCategory = "LEGIONELLA MONITORING"
strLocation = "Gents1 Lhs Shower (Carriage)"

strSql = "TRANSFORM Sum(tblTestResults.TestResultsResults) AS
SumOfTestResultsResults " & _
"SELECT tblTestResults.TestResultsDateSampled " & _
"FROM (tblTestDetails INNER JOIN tblTest ON (tblTestDetails.TestName =
tblTest.TestName) AND (tblTestDetails.TestCategory = tblTest.TestCategory))
INNER JOIN tblTestResults ON tblTestDetails.TestDetailsIdentifier =
tblTestResults.TestDetailsIdentifier " & _
"WHERE (((tblTestResults.TestResultsDateSampled) In (select top 4
tbltestresults.testresultsdatesampled from tbltestresults)) AND
((tblTestDetails.CategoryName)='" & strCategory & "') AND
((tblTestDetails.LocationName)='" & strLocation & "')) " & _
"GROUP BY tblTestResults.TestResultsDateSampled " & _
"ORDER BY tblTestResults.TestResultsDateSampled DESC , tblTest.TestName " &
_
"PIVOT tblTest.TestName;"

CurrentDb.QueryDefs("qryXTabLast4ResultsByDate").SQL = strSql

DoCmd.OpenReport "rptXTabLast4ResultsByDate", acViewPreview

End Sub

This open routine changes the source for the 4 fields on the report

Private Sub Report_Open(Cancel As Integer)

Me.Controls("txtBox1").ControlSource = "BOD (mg/l)"
Me.Controls("txtBox2").ControlSource = "pH"
Me.Controls("txtBox3").ControlSource = "Suspended solids (mg/l)"
Me.Controls("txtBox4").ControlSource = "Total oil (mg/l"
End Sub

But I am now getting the error 3270 - property not found.

Any suggestions ?

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Property Not Found error 11
Run-Time Error 2115 1

Top