Closing a form

  • Thread starter Thread starter alvin Kuiper
  • Start date Start date
A

alvin Kuiper

Hi
I try this:
Private Sub Form_Current()
If cprnr.Value <> "" Then
Something
Else
docmd.close
End If

But it is not the form i'm in there close but thr form before this form
the form before i want to be open allways, so what i want is that
If cprnr.Value = "" then close the form

Alvin
 
alvin Kuiper said:
Hi
I try this:
Private Sub Form_Current()
If cprnr.Value <> "" Then
Something
Else
docmd.close
End If

But it is not the form i'm in there close but thr form before this form
the form before i want to be open allways, so what i want is that
If cprnr.Value = "" then close the form

Alvin

DoCmd.Close without providing any arguments will close 'the currently active
database object'. Try using:

DoCmd.Close acForm, Me.Name
 
Back
Top