Function UslovQuery() Dim Forma As Boolean UslovQuery = "0000" Forma = Otvorena("frmOtpremnicaSub") If Forma = True Then UslovQuery = Forms![frmOtpremnicaSub]![OrderID] End If Forma = Otvorena("TraziRacun") If Forma = True Then UslovQuery = Forms![TraziRacun]![txtOrderID] End If End Function Function Otvorena(ImeForme) '---------------------------------------- ' DA LI JE ODREENA FORMA OTVORENA ' poziva se otvorena(Imeforme) 'Ako jeste vraca True '---------------------------------------- Const FORM_DESIGN = 0 Dim I As Integer Otvorena = False For I = 0 To Forms.Count - 1 If Forms(I).FormName = ImeForme Then If Forms(I).CurrentView <> FORM_DESIGN Then Otvorena = True Exit Function ' Izlaz iz funkcije End If End If Next End Function