Predmet:Re: Autonumber se ponavlja
Pobrisi format na polju u tabeli i popravi ovo ja sam pogrijesio.
PreuzmiIzvorni kôd (Visual Basic):Private Sub Form_Current()
Dim Db As Database
Dim Rs As Recordset
Dim Sql As String
Dim IDstr As String * 8
Dim IDBroj As Single
Sql = "SELECT Last(PROCES.ID_String) AS LastOfID_String " _
& "FROM PROCES"
Set Db = CurrentDb
Set Rs = Db.OpenRecordset(Sql)
If Rs.Fields(0) <> "" Then
IDBroj = Val(Rs.Fields(0))
End If
IDBroj = IDBroj + 1
IDstr = Format(IDBroj, "00000000")
'ovo popravi:
Me.ID_String.DefaultValue = "'" & IDstr & "'"
Rs.Close
Set Db = Nothing
End Sub
Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.