Hi i have a form, that ask me my username and password, and works perfect, also save me a history record, of who enter to the sistem and what time and what date, that also works fine i use this
Dim rst As DAO.Recordset
Set rst = CurrentDb.TableDefs("historialacceso").OpenRecordset
rst.AddNew
rst!Username = Me.cmbLogin
rst!Fecha = Now()
rst!Hora = Now()
rst.Update
rst.Close
Set rst = Nothing
now i want to add a history when people enter to a seccion of the program so i use this
Dim rst As DAO.Recordset
Dim var As Variant
var = DLookup("[username]", "historialacceso", "0")
Set rst = CurrentDb.TableDefs("historial_registroasset").OpenRecordset
rst.AddNew
rst!Username = var
rst!Fecha = Now()
rst!Hora = Now()
rst.Update
rst.Close
Set rst = Nothing
i use dlookup to find the username, because i close the form, wheere i copy to the first history table!
but, my problem is this one, how can i use the dlookup to search fro the last record of the history table??
Dim rst As DAO.Recordset
Set rst = CurrentDb.TableDefs("historialacceso").OpenRecordset
rst.AddNew
rst!Username = Me.cmbLogin
rst!Fecha = Now()
rst!Hora = Now()
rst.Update
rst.Close
Set rst = Nothing
now i want to add a history when people enter to a seccion of the program so i use this
Dim rst As DAO.Recordset
Dim var As Variant
var = DLookup("[username]", "historialacceso", "0")
Set rst = CurrentDb.TableDefs("historial_registroasset").OpenRecordset
rst.AddNew
rst!Username = var
rst!Fecha = Now()
rst!Hora = Now()
rst.Update
rst.Close
Set rst = Nothing
i use dlookup to find the username, because i close the form, wheere i copy to the first history table!
but, my problem is this one, how can i use the dlookup to search fro the last record of the history table??