hi everyone... im new at this but can someone tell me how i am supposed to write this code. It complains on this row:
Me!Risker = Me!hiddenEnvi_Risk_Class And Me!hiddenPro_Risk_Class
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim Re As DAO.Recordset
Dim ReSum As DAO.Recordset
Dim ReFreq As DAO.Recordset
Dim Envi_Risk_Class, Pro_Risk_Class, Risk, tot
Set Re = CurrentDb.OpenRecordset("SELECT Envi_Risk_Class, Pro_Risk_Class, HazardID FROM tblHazard Where Envi_Risk_Class ='" & Me!hiddenEnvi_Risk_Class & "' AND Pro_Risk_Class ='" & Me!hiddenPro_Risk_Class & "' ORDER BY HazardID"
Risk = ""
Set ReSum = CurrentDb.OpenRecordset("SELECT COUNT(HazardID) As HazardTotal FROM tblHazard Where Envi_Risk_Class ='" & Me!hiddenEnvi_Risk_Class & "' AND Pro_Risk_Class ='" & Me!hiddenPro_Risk_Class & "'"
txtSumTotal = ReSum("HazardTotal"
Set ReFreq = CurrentDb.OpenRecordset("SELECT SUM(Envi_Freq) As Total FROM tblHazard Where Envi_Risk_Class ='" & Me!hiddenEnvi_Risk_Class & "'"
txtTotal = ReFreq("Total"
Me!Risker = Me!hiddenEnvi_Risk_Class And Me!hiddenPro_Risk_Class
Do While Not Re.EOF
Risk = Risk & Re!HazardID & ", "
Re.MoveNext
Loop
Me!ID = Left(Risk, Len(Risk) - 2)
End Sub
Me!Risker = Me!hiddenEnvi_Risk_Class And Me!hiddenPro_Risk_Class
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim Re As DAO.Recordset
Dim ReSum As DAO.Recordset
Dim ReFreq As DAO.Recordset
Dim Envi_Risk_Class, Pro_Risk_Class, Risk, tot
Set Re = CurrentDb.OpenRecordset("SELECT Envi_Risk_Class, Pro_Risk_Class, HazardID FROM tblHazard Where Envi_Risk_Class ='" & Me!hiddenEnvi_Risk_Class & "' AND Pro_Risk_Class ='" & Me!hiddenPro_Risk_Class & "' ORDER BY HazardID"
Risk = ""
Set ReSum = CurrentDb.OpenRecordset("SELECT COUNT(HazardID) As HazardTotal FROM tblHazard Where Envi_Risk_Class ='" & Me!hiddenEnvi_Risk_Class & "' AND Pro_Risk_Class ='" & Me!hiddenPro_Risk_Class & "'"
txtSumTotal = ReSum("HazardTotal"
Set ReFreq = CurrentDb.OpenRecordset("SELECT SUM(Envi_Freq) As Total FROM tblHazard Where Envi_Risk_Class ='" & Me!hiddenEnvi_Risk_Class & "'"
txtTotal = ReFreq("Total"
Me!Risker = Me!hiddenEnvi_Risk_Class And Me!hiddenPro_Risk_Class
Do While Not Re.EOF
Risk = Risk & Re!HazardID & ", "
Re.MoveNext
Loop
Me!ID = Left(Risk, Len(Risk) - 2)
End Sub