Private Sub Command7_Click() Dim KolSum As Single Dim proizvod As String Dim Ulaz As Single proizvod = Forms![kasa]![detalji].Form![proizvod] KolSum = DLookup("suma", "QSUMA", "Proizvod='" & proizvod & "'") Ulaz = Me.Ulaz If Ulaz > KolSum Then MsgBox "Ima samo:" & KolSum Me.Ulaz = KolSum Me.Ulaz.SetFocus GoTo Kraj End If If Me.Ulaz <> "" Then strOdg = Me.Ulaz DoCmd.Close End If Kraj: End Sub