Morning people I have a problem with some vba coding, basically I have this code
#Private Sub Text6_DblClick(Cancel As Integer)
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim i As Integer
Dim strSQL As String
Set dbs = CurrentDb
strSQL = "select * from [tbl sale invoices]"
Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset)
rst.MoveLast
i = rst![Sale Invoice ID]
Forms![FRM Invoice dataview]!Text6 = i + 1
Set rst = Nothing
Set dbs = Nothing
End Sub#
now I don't know what the customer has done as when I handed it over this always worked as it should (generating the next highest number for there invoice number), but now it seems to be suck on a specific number "6009" if i keep double clicking on other orders it starts plusing one and then randomly goes back to "6009"??? if I carrying on click again will again start adding from the highest number again?
#Private Sub Text6_DblClick(Cancel As Integer)
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim i As Integer
Dim strSQL As String
Set dbs = CurrentDb
strSQL = "select * from [tbl sale invoices]"
Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset)
rst.MoveLast
i = rst![Sale Invoice ID]
Forms![FRM Invoice dataview]!Text6 = i + 1
Set rst = Nothing
Set dbs = Nothing
End Sub#
now I don't know what the customer has done as when I handed it over this always worked as it should (generating the next highest number for there invoice number), but now it seems to be suck on a specific number "6009" if i keep double clicking on other orders it starts plusing one and then randomly goes back to "6009"??? if I carrying on click again will again start adding from the highest number again?