Hi.
Ive got an unbound form which i have linked to my database.
What im trying to do is when the form is open, it pre-fills with the last record that was entered into the databse.
Now ive got it looking at the database and it does bring up the 1st record.
What i cant figure out is how do i get it to look at the last record in the database.
This is my code so far:
Dim getTableRecord As DAO.Recordset
Dim dbs As Database
Private Sub form_load()
Set dbs = CurrentDb
Set getTableRecord = dbs.OpenRecordset("tblProduct")
txtProdID.Locked = True
txtDescription.Locked = True
txtCategory.Locked = True
txtSize.Locked = True
txtQuantity.Locked = True
txtPrice.Locked = True
txtProdID.Value = getTableRecord("ProductID")
txtDescription.Value = getTableRecord("Description")
txtCategory.Value = getTableRecord("Category")
txtSize.Value = getTableRecord("Size")
txtQuantity.Value = getTableRecord("Quantity")
txtPrice.Value = getTableRecord("Price")
End Sub
what that does atm is prefill the boxes but with the data thats on the 26th record. Got no idea why thats happening. So how do i get it to load the data thats on the last record??
Thanks for the help..