A family of Microsoft relational database management systems designed for ease of use.
What exactly are you trying to do? The Execute method is meant to run an action query. Are you wishing to run your SQL to return a value? If so, then you are probably best to use the OpenRecordset, something more like:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim iCount As Integer
Dim strSQL As String
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSQL) 'open the recordset for use (table, Query, SQL Statement)
With rs
If .RecordCount <> 0 Then 'Ensure that there are actually records to work with
'The next 2 line will determine the number of returned records
rs.MoveLast 'This is required otherwise you may not get the right count
iCount = rs.RecordCount 'Determine the number of returned records
Do While Not .BOF
'Do something with the recordset/Your Code Goes Here
PerfEvalCalc = ![PerfEvalCalc]
.MovePrevious
Loop
End If
End With
rs.Close 'Close the recordset
Set rs = Nothing
Set db = Nothing
Me.txtPerfEvalCalc =PerfEvalCalc
Daniel Pineault
http://www.cardaconsultants.com
strSQL = "SELECT tblRLS.EmplID, 0.1666*(tblRLS![1Opt]+tblRLS![2Opt]+tblRLS![3Opt]+tblRLS![4Opt]+tblRLS![5Opt]+tblRLS![6Opt])*0.5+0.25*(tblRDS!CPCDOpt+tblRDS!PDOpt+tblRDS!SQSOpt+tblRDS!UOOpt)*0.5 AS PerfEvalCalc " & vbCrLf & _
"FROM tblRLS INNER JOIN tblRDS ON tblRLS.EmplID = tblRDS.EmplID " & vbCrLf & _
"WHERE (((tblRLS.EmplID)=[Forms]![frmPerfEval]![EmplID]));"