Re: Run-time Error 2001: You cancelled the previous operation



Allan,

Many thanks for your suggestion, however, I have changed the code as
you suggested and it still produces the same error. Code below:

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim check_project As String
check_project = DLookup("[Compliance Level]", "Project
Information", "[ProjectID] = Project1")
If check_project = True Then
If IsNull(Me.Compliance_Level) Or Me.Compliance_Level = "" Then
MsgBox "Please enter the Compliance Level"
Me.Compliance_Level.SetFocus
Cancel = True
Else
MsgBox "Not Null"
End If
End If
End Sub

Any more thoughts?

Andy.

.



Relevant Pages

  • Re: NotinList Event
    ... tried and couldn't get it to work I did find my error and ur suggestion does, ... Private Sub Combo_NotInList(NewData As String, Response As Integer) ... Then, in the form that opens, you can set the value to the openargs ...
    (microsoft.public.access.formscoding)
  • Re: How to disable delete operation
    ... Private Sub Worksheet_SelectionChange ... Regarding your suggestion for a revised formula in my total cell, ...
    (microsoft.public.excel.programming)
  • Re: Format number field to show Percent
    ... Any suggestion? ... Private Sub controlname_AfterUpdate ... "Jeff Boyce" wrote: ... context/definition. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: open a file from MS Access form
    ... Private Sub Command51_Click ... has a field CodSig as well. ... I would like a cmd button in my MS Access Form to open the BlqA.apr. ... suggestion to code the cmd button is welcome. ...
    (microsoft.public.access.formscoding)
  • Re: Show full path of files being saved
    ... So while your suggestion is appreciated, ... Private Sub App_WindowActivate(ByVal Wb As Workbook, ... when saving a file to show the complete path of the file I am saving. ...
    (microsoft.public.excel.misc)