Display custom error if field is null or zero

steve87bg

Registered User.
Local time
Tomorrow, 00:19
Joined
Jan 14, 2013
Messages
19
I have a code
Code:
Private Sub Dodaj_Click()

DoCmd.RunCommand acCmdSaveRecord
DoCmd.SetWarnings False
DoCmd.OpenQuery ("updateDodaj")
DoCmd.SetWarnings True

On Error GoTo Err_Dodaj_Click

DoCmd.GoToRecord , , acNewRec
Me.DatumKnjizenja.SetFocus

Me.DatumKnjizenja = ""
Me.Kom = 0
Me.Gr = 0

Me.Dodaj.Enabled = False

Exit_Dodaj_Click:
Exit Sub

Err_Dodaj_Click:
MsgBox Err.Description
Resume Exit_Dodaj_Click

Now i whant if me.Gr or me.Kom is null or zero to display error message.
 
Did you try:
Code:
  If IsNull(Me.Kom) or IsNull(Me.Gr) then
    MsgBox("Your message here")
  EndIf
 
:)Thanks. That helped
 

Users who are viewing this thread

Back
Top Bottom