Function Citaj() On Error GoTo Citaj_Err Dim temp As String Dim Jedan_red As String Dim Poz As String Dim Poz1 As String Dim RukaPo As String Close #1 'Open ("" & DLookup("[Putanja]", "[Put]") & "\Rac" & [Forms]![Osnovna tabela Q VP1]![Datum] & " " & [Forms]![Osnovna tabela Q VP1]![Index] & ".inp") For Input As 1 Open ("C:\HCP\FROM_FP\Bill_State.xml") For Input As 1 While Not EOF(1) Line Input #1, Jedan_red temp = temp & Jedan_red & vbCrLf Poz = InStr(1, temp, "RECEIPT_NUMBER=") Poz1 = InStr(1, temp, "REFOUND_RECEIPT_NUMBER") RukaPo = Mid(temp, Poz + 17, [Poz1] - [Poz] - 19) Wend Close #1 If Poz > 0 Then MsgBox "Fiskalni broj racuna je: " & [RukaPo], vbCritical, "UPOZORENJE" Else MsgBox "UPSSS" End If Citaj_Exit: Exit Function Citaj_Err: MsgBox Error$ Resume Citaj_Exit End Function