hi All,
Can you please help me with this error msg. I get an "Unexpected Error" Message box with a Big Red X followed by the message "0:"
I have a form with a "FilterOn" based on a text box's after update event. This in turns calls a function that gives me the error. After that my Filter on "after Update" ceases to work.
Private Sub txtTime_AfterUpdate()
If IsNull(Me![txtTime]) Then
Me.FilterOn = False
Else
Me.Filter = "[PERIOD] = '" & Me![txtTime] & "'"
Me.FilterOn = True
Me.Requery
End If
LockPeriod
End Sub
Public Function LockPeriod()
On Error GoTo errHandler
Dim PlanLocked As Boolean
PlanLocked = DLookup("Locked", "tbl_CustomerRecord", "[Period] = '" & Me![txtTime] & "'")
If (PlanLocked = True) Then
Me.AllowEdits = False
Me.AllowAdditions = False
Me.AllowDeletions = False
Else
Me.AllowEdits = True
Me.AllowAdditions = True
Me.AllowDeletions = True
End If
errHandler:
MsgBox Err.Number & " : " & Err.Description, vbCritical, "Unexpected Error"
End Function
-------------
thanks
D
Can you please help me with this error msg. I get an "Unexpected Error" Message box with a Big Red X followed by the message "0:"
I have a form with a "FilterOn" based on a text box's after update event. This in turns calls a function that gives me the error. After that my Filter on "after Update" ceases to work.
Private Sub txtTime_AfterUpdate()
If IsNull(Me![txtTime]) Then
Me.FilterOn = False
Else
Me.Filter = "[PERIOD] = '" & Me![txtTime] & "'"
Me.FilterOn = True
Me.Requery
End If
LockPeriod
End Sub
Public Function LockPeriod()
On Error GoTo errHandler
Dim PlanLocked As Boolean
PlanLocked = DLookup("Locked", "tbl_CustomerRecord", "[Period] = '" & Me![txtTime] & "'")
If (PlanLocked = True) Then
Me.AllowEdits = False
Me.AllowAdditions = False
Me.AllowDeletions = False
Else
Me.AllowEdits = True
Me.AllowAdditions = True
Me.AllowDeletions = True
End If
errHandler:
MsgBox Err.Number & " : " & Err.Description, vbCritical, "Unexpected Error"
End Function
-------------
thanks
D