A
Anita
I have a subform. Before Insert, I create a recordest to one of the
underlying tables to add a new record. I then update some field values and
capture the primary key values (Entity ID and Contact Id). I update the form
fields with these values and do a requery. (If I don't take these steps, I
get an error message that the record can't be created due to null values.)
The problem is, once I requery, Access defaults to the first record in the
recordset, when I want it to go to the last. I've tried docmd.gotorecord,
I've tried setfocus and a thousand other different attempts with no success.
How can I get to the last record in my subform?
With rstContact
.Source = "Select * from Contact"
.ActiveConnection = conContact
.LockType = adLockOptimistic
.Open
.AddNew
![Contact Type] = "Address"
![Notes ID] = 3
.Update
End With
Me.[Entity ID] = intEntityID
Me.[Contact ID] = intContactID
Me.Requery
underlying tables to add a new record. I then update some field values and
capture the primary key values (Entity ID and Contact Id). I update the form
fields with these values and do a requery. (If I don't take these steps, I
get an error message that the record can't be created due to null values.)
The problem is, once I requery, Access defaults to the first record in the
recordset, when I want it to go to the last. I've tried docmd.gotorecord,
I've tried setfocus and a thousand other different attempts with no success.
How can I get to the last record in my subform?
With rstContact
.Source = "Select * from Contact"
.ActiveConnection = conContact
.LockType = adLockOptimistic
.Open
.AddNew
![Contact Type] = "Address"
![Notes ID] = 3
.Update
End With
Me.[Entity ID] = intEntityID
Me.[Contact ID] = intContactID
Me.Requery