koolwaters
Active Member
- Joined
- May 16, 2007
- Messages
- 403
Hello!
I have the code below in the Before Update event of a form in my database, but I get "3251- Oeration is not supported for this type of object" and I am not sure why.
Can someone help me please.
Thanks
I have the code below in the Before Update event of a form in my database, but I get "3251- Oeration is not supported for this type of object" and I am not sure why.
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo ErrorHandler
Dim i As Integer
If IsNull(Me.StartDate) = True Then
i = MsgBox("Please enter the Program Start Date.", vbCritical, gstrAppTitle)
Me.StartDate.SetFocus
DoCmd.CancelEvent
Exit Sub
End If
If IsNull(Me.EndDate) = True Then
i = MsgBox("Please enter the Program Completion Date.", vbCritical, gstrAppTitle)
Me.EndDate.SetFocus
DoCmd.CancelEvent
Exit Sub
End If
If IsNull(Me.ApplicationDate) = True Then
i = MsgBox("Please enter the Application Date.", vbCritical, gstrAppTitle)
Me.ApplicationDate.SetFocus
DoCmd.CancelEvent
Exit Sub
End If
If IsNull(Me.ImmediateManager) = True Then
i = MsgBox("Please enter or choose the applicant's Immediate Manager.", vbCritical, gstrAppTitle)
Me.ImmediateManager.SetFocus
DoCmd.CancelEvent
Exit Sub
End If
If IsNull(Me.DateSent) = True Then
i = MsgBox("Please enter the date application was sent for approval.", vbCritical, gstrAppTitle)
Me.DateSent.SetFocus
DoCmd.CancelEvent
Exit Sub
End If
If (Me.Decision.Column(1) = "Approved") Then
If IsNull(Me.BondingStartDate) = True Then
i = MsgBox("Please enter the Bonding Start Date for this application.", vbCritical, gstrAppTitle)
Me.BondingStartDate.SetFocus
DoCmd.CancelEvent
Exit Sub
End If
End If
If (Me.Decision.Column(1) = "Approved") Then
If IsNull(Me.BondingEndDate) = True Then
i = MsgBox("Please enter the Bonding End Date for this application.", vbCritical, gstrAppTitle)
Me.BondingEndDate.SetFocus
DoCmd.CancelEvent
Exit Sub
End If
End If
If (Me.LevelOfStudy.Column(1) = "Professional Studies") Then
If IsNull(Me.ProfessionalStudy) = True Then
i = MsgBox("You have entered Professional Study as the Level of Study." & vbCrLf & vbCrLf & "Please enter the Professional Study.", vbCritical, gstrAppTitle)
Me.ProfessionalStudy.SetFocus
Me.ProfessionalStudy.Dropdown
DoCmd.CancelEvent
Exit Sub
End If
End If
ErrorHandler:
If Err.Number = 2001 Then
Else
MsgBox Err.Description
End If
End Sub
Can someone help me please.
Thanks