N
niuginikiwi
Hi Allen,
I have followed one of your postings here but can not be able to add
any errors to tLogErrors table...
Is there anything else I am missing out. I am using mztools.com to add
in error handling.
Here is the code I am trying out:
Dim lst As ListBox
Dim cbo As ComboBox
Dim iLen As String
Const conDateFormat = "\#mm\/dd\/yyyy\#"
Dim strWhere As String
Dim strDoc As String
On Error GoTo Err_Handler
'Purpose:
20 strDoc = "rptOperationSchedule"
30 Set lst = Me.lstPlantings
40 If lst.ItemsSelected.Count > 0 Then
50 strWhere = strWhere & "(PlantingDetailsID" &
MultiSelectSQL(Me.lstPlantings) & ") AND "
60 End If
' Set lst = Me.lstProducts
' If lst.ItemsSelected.Count > 0 Then
' strWhere = strWhere & "(ProductID" &
MultiSelectSQL(Me.lstProducts) & ") AND "
' End If
70 Set cbo = Me.cboOperation
80 If Not IsNull(cbo) Then
90 strWhere = strWhere & "(OperationID = " & cbo.Column(0)
& ") AND "
100 End If
110 If Not IsNull(Me.txtApplicationDate) Then
120 strWhere = strWhere & "([ApplicationDate] = " &
Format(Me.txtApplicationDate, conDateFormat) & ") AND "
130 End If
'Did we get anything?
140 iLen = Len(strWhere) - 5 'Without trailing " AND ".
150 If iLen < 1 Then
160 MsgBox "Sorry! one/more criteria must be supplied",
vbInformation, "Criteria Required"
170 Else
180 strWhere = Left$(strWhere, iLen)
'Use it for this form.
190 Me.Filter = strWhere
200 Me.FilterOn = True
210 If CurrentProject.AllReports(strDoc).IsLoaded Then
220 DoCmd.Close acReport, strDoc
230 End If
240 DoCmd.OpenReport strDoc, acPreview, , strWhere
250 End If
260 Set cbo = Nothing
270 Set lst = Nothing
Exit_Handler:
Exit Sub
Err_Handler:
Call LogError(Err.Number, Err.Description, conMod &
".btnJobSheet_Click")
Resume Exit_Handler
End Sub
What delibrate errors can i cause in there that would be able to
trigger the function you provided at your website to record the error
on to the table.
Thanks,
niuginikiwi
I have followed one of your postings here but can not be able to add
any errors to tLogErrors table...
Is there anything else I am missing out. I am using mztools.com to add
in error handling.
Here is the code I am trying out:
Dim lst As ListBox
Dim cbo As ComboBox
Dim iLen As String
Const conDateFormat = "\#mm\/dd\/yyyy\#"
Dim strWhere As String
Dim strDoc As String
On Error GoTo Err_Handler
'Purpose:
20 strDoc = "rptOperationSchedule"
30 Set lst = Me.lstPlantings
40 If lst.ItemsSelected.Count > 0 Then
50 strWhere = strWhere & "(PlantingDetailsID" &
MultiSelectSQL(Me.lstPlantings) & ") AND "
60 End If
' Set lst = Me.lstProducts
' If lst.ItemsSelected.Count > 0 Then
' strWhere = strWhere & "(ProductID" &
MultiSelectSQL(Me.lstProducts) & ") AND "
' End If
70 Set cbo = Me.cboOperation
80 If Not IsNull(cbo) Then
90 strWhere = strWhere & "(OperationID = " & cbo.Column(0)
& ") AND "
100 End If
110 If Not IsNull(Me.txtApplicationDate) Then
120 strWhere = strWhere & "([ApplicationDate] = " &
Format(Me.txtApplicationDate, conDateFormat) & ") AND "
130 End If
'Did we get anything?
140 iLen = Len(strWhere) - 5 'Without trailing " AND ".
150 If iLen < 1 Then
160 MsgBox "Sorry! one/more criteria must be supplied",
vbInformation, "Criteria Required"
170 Else
180 strWhere = Left$(strWhere, iLen)
'Use it for this form.
190 Me.Filter = strWhere
200 Me.FilterOn = True
210 If CurrentProject.AllReports(strDoc).IsLoaded Then
220 DoCmd.Close acReport, strDoc
230 End If
240 DoCmd.OpenReport strDoc, acPreview, , strWhere
250 End If
260 Set cbo = Nothing
270 Set lst = Nothing
Exit_Handler:
Exit Sub
Err_Handler:
Call LogError(Err.Number, Err.Description, conMod &
".btnJobSheet_Click")
Resume Exit_Handler
End Sub
What delibrate errors can i cause in there that would be able to
trigger the function you provided at your website to record the error
on to the table.
Thanks,
niuginikiwi