S
Stapes
Hi
I have the following code in my Form_Current procedure. I have put
breahpoints in it to try and discover why the error message is coming
out twice. After executing the Exit Sub line, it continues processing
from line 12!! If I remove the statement lines 10-12, it goes to line
7. Help. What is happening?
1 Private Sub Form_Current()
2 On Error GoTo Form_Current_Err
3
4 RecCount = Me.Recordset.RecordCount
5 Dim lngRed As Long, lngWhite As Long
6
7 lngRed = RGB(255, 0, 0)
8 lngWhite = RGB(255, 255, 255)
9
10 If IsNull([BalanceDue]) Or [BalanceDue] = 0 Then
11 [BalanceDue] = DateAdd("ww", -8, [DateOfArrival])
12 End If
13
14 If [BalanceDue] < Date And [Balance] <> 0 Then
15 [BalanceDue].BackColor = lngRed
16 Else
17 [BalanceDue].BackColor = lngWhite
18 End If
19
20 If Deposit < (RentalAmount / 3) - 0.01 And FullPayment <>
RentalAmount Then
21 MsgBox "Warning: Deposit " & Deposit & " is less than 1/3rd of
Rental Amount. Deposit should be at least " & Format(RentalAmount / 3
- 0.01, "$###0.00")
22 End If
23
24 Form_Current_Exit:
25 Exit Sub
26 Form_Current_Err:
27 MsgBox Err.Number & ":" & Err.Description
28 End Sub
Stapes
I have the following code in my Form_Current procedure. I have put
breahpoints in it to try and discover why the error message is coming
out twice. After executing the Exit Sub line, it continues processing
from line 12!! If I remove the statement lines 10-12, it goes to line
7. Help. What is happening?
1 Private Sub Form_Current()
2 On Error GoTo Form_Current_Err
3
4 RecCount = Me.Recordset.RecordCount
5 Dim lngRed As Long, lngWhite As Long
6
7 lngRed = RGB(255, 0, 0)
8 lngWhite = RGB(255, 255, 255)
9
10 If IsNull([BalanceDue]) Or [BalanceDue] = 0 Then
11 [BalanceDue] = DateAdd("ww", -8, [DateOfArrival])
12 End If
13
14 If [BalanceDue] < Date And [Balance] <> 0 Then
15 [BalanceDue].BackColor = lngRed
16 Else
17 [BalanceDue].BackColor = lngWhite
18 End If
19
20 If Deposit < (RentalAmount / 3) - 0.01 And FullPayment <>
RentalAmount Then
21 MsgBox "Warning: Deposit " & Deposit & " is less than 1/3rd of
Rental Amount. Deposit should be at least " & Format(RentalAmount / 3
- 0.01, "$###0.00")
22 End If
23
24 Form_Current_Exit:
25 Exit Sub
26 Form_Current_Err:
27 MsgBox Err.Number & ":" & Err.Description
28 End Sub
Stapes