Pusher
BEOGRAD Put
- Local time
- Tomorrow, 00:51
- Joined
- May 25, 2011
- Messages
- 230
Hi all,
I made a Msgbox popup when i press make new record that did not fill all the conditions for making a new record. But when i click x on my window it makes a new record in my table. How do I disable this?
Also what happens when you click on the x of the window and how can i implement a msgbox that will prompt my exit, and maybe condition it on something else?
Here is my Button code if you need it.
Thanks
I made a Msgbox popup when i press make new record that did not fill all the conditions for making a new record. But when i click x on my window it makes a new record in my table. How do I disable this?
Also what happens when you click on the x of the window and how can i implement a msgbox that will prompt my exit, and maybe condition it on something else?
Here is my Button code if you need it.
Code:
Private Sub Nova_intervencija_Click()
On Error GoTo Err_Command76_Click
Cancel = False
' If Field1 is Empty then Cancel = True
Cancel = Cancel Or (Nz(Me.DATUM_IZVESTAJA, "") = "")
' If Field2 is Empty then Cancel = True
Cancel = Cancel Or (Nz(Me.ID_RASKRSNICE, "") = "")
Cancel = Cancel Or (Nz(Me.ID_OSOBE_PRIJAVE, "") = "")
Cancel = Cancel Or (Nz(Me.ID_STANJA_PRIJAVE, "") = "")
Cancel = Cancel Or (Nz(Me.VREME_KVARA, "") = "")
If Cancel = True Then
' If Cancel = True then show message
MsgBox "Ako polja Datum, Raskrsnica,Osoba Prijave,Stanje prijave i Vreme kvara nisu popunjene ne možete da otvorite sledeæu intervenciju.", vbInformation + vbOKOnly
Else
DoCmd.GoToRecord , , acNewRec
End If
Exit_Command76_Click:
Exit Sub
Err_Command76_Click:
MsgBox Err.Description
Resume Exit_Command76_Click
End Sub