It gives: "Fout 2585 tijdens uitvoering: U kunt deze actie niet uitvoeren
terwijl een formulier- of rapportgebeurtenis wordt verwerkt."
That is the dutch version, I will try to translate:
"Error 2585 during event: U cannot perform this action while a form- or
report event is pending"
It doesn't matter where I put the code (on opening, close, after update,
before update), it generates the error as soon as the DoCMD.Close acform,
"MIS NONDEAL" is executed:
Private Sub Form_Current()
If Form.NewRecord = True Then
If DCount("Id", "Urenregistratie") = 4026 Then
MsgBox "Sorry, deze registratie gaat maar tot en met 31-12-2004 voor
Engineers. U probeert óf na deze dag toe te voegen óf u bent niet gerechtigd
informatie toe te voegen.", vbOKOnly, "Toevoegen niet mogelijk"
DoCmd.Close acForm, "MIS DEAL"
End If
End If
End Sub
If I delete the DoCmd.Close acForm, "MIS DEAL" it executes with no
errors but allows a record to be added to the table.
I want this form closed as soon as someone tries to open a record.
Any idea's, examples?
TIA Henro
"Arno R" <ar****************@tiscali.nl> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
Henro,
What error? Maybe the record can't be saved?
I think you don't want the record to be saved?
Hence I think you could use Me.undo before trying to close
--
Hope this helps
Arno R
"Henro V" <ma**********@hotmail.com> schreef in bericht
news:bp**********@news4.tilbu1.nb.home.nl...
Private Sub Form_Current()
If Form.NewRecord = True Then
If DCount("Id", "Urenregistratie") = 4026 Then
MsgBox "Sorry, deze registratie gaat maar tot en met
31-12-2004", vbOKOnly, "Toevoegen niet mogelijk"
DoCmd.Close
End If
End If
End Sub
It gives me an error on the command
DoCmd.Close.
How do I get the form to close if someone tries to add an account?
TIA
Henro
P.S. Do you have trouble too finding anything at all in the new
helpfunction in Access2003?