Closing a form

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
 
S

Stuart McCall

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top