I have a code that wont work. If i click add button when all field are null then i see message box for first if function. Then if i fill the first field and left all other field null and click add button i dont see any message box and record is added to the tables. Anyone know why is this happening to me?
Is there a lot of message boxes?
:banghead::banghead::banghead:
Is there a lot of message boxes?
:banghead::banghead::banghead:
Code:
Private Sub Add_Click()
If IsNull(Me.DatumKnjizenja) Then
MsgBox "Molim vas unesite DATUM.", vbInformation, "Greška"
Me.DatumKnjizenja.SetFocus
Exit Sub
Else
If IsNull(Me.Naziv) Then
MsgBox "Molim vas unesite NAZIV KOMITENTA.", vbInformation, "Greška"
Me.Naziv.SetFocus
Exit Sub
Else
If IsNull(Me.BrRacuna) Then
MsgBox "Molim vas unesite BROJ RACUNA.", vbInformation, "Greška"
Me.BrRacuna.SetFocus
Exit Sub
If IsNull(Me.DatumIzdavanja) Then
MsgBox "Molim vas unesite DATUM IZDAVANJA RACUNA.", vbInformation, "Greška"
Me.DatumIzdavanja.SetFocus
Exit Sub
Else
If IsNull(Me.PDVStopa) Then
MsgBox "Molim vas unesite PDV STOPU.", vbInformation, "Greška"
Me.PDVStopa.SetFocus
Exit Sub
Else
If IsNull(Me.IznosSaPDVom) Then
MsgBox "Molim vas unesite IZNOS RACUNA.", vbInformation, "Greška"
Me.IznosSaPDVom.SetFocus
Exit Sub
Else
If IsNull(Me.RokPlacanja) Then
MsgBox "Molim vas unesite ROK PLACANJA.", vbInformation, "Greška"
Me.RokPlacanja.SetFocus
Exit Sub
Else
If Me.txtDaNe = "DA" And IsNull(Me.txtRoba) Then
MsgBox "Molim vas unesite PRODAJNU VREDNOST ROBE.", vbInformation, "Greška"
Me.txtRoba.SetFocus
Exit Sub
Else
If Me.txtDaNe = "DA" And IsNull(Me.VrstaRobe) Then
MsgBox "Molim vas unesite VRSTU ROBE.", vbInformation, "Greška"
Me.VrstaRobe.SetFocus
Exit Sub
Else
End If
End If
End If
End If
End If
End If
End If
End If
End If
....................