freetobreed
New member
- Local time
- Today, 10:30
- Joined
- Jan 6, 2005
- Messages
- 6
Every time i try to get the value on the field numero chamada it returns me the value 4 even if before the value it's different (let's say 15). Instead of giving me back the value 16 it gives me every time 4. Can anyone explain me why?
Thanks
Here's the code below
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim num As Integer
' open a connection to the current database
Set db = CurrentDb
Set rs = db.OpenRecordset("Log")
rs.MoveLast
num = rs.Fields("numero chamada")
numerochamada.SetFocus
numerochamada.Text = num + 1
rs.AddNew
rs.Fields("numero chamada").Value = numerochamada.Text
rs.Update
rs.Close
Exit Sub
Thanks
Here's the code below
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim num As Integer
' open a connection to the current database
Set db = CurrentDb
Set rs = db.OpenRecordset("Log")
rs.MoveLast
num = rs.Fields("numero chamada")
numerochamada.SetFocus
numerochamada.Text = num + 1
rs.AddNew
rs.Fields("numero chamada").Value = numerochamada.Text
rs.Update
rs.Close
Exit Sub