Single Record Requery

Manged

Registered User.
Local time
Yesterday, 22:58
Joined
Jun 30, 2010
Messages
10
Is it possible to requery a single record? I have a datasheet on which I have records that can be clicked and when clicked i want them to change. The change part is easy but I dont want to requery the entire form because it will reset my view not to mention being unnecessary. I can do it with this code but it only requerys it once and then i have to deselect the record and click it again in order requery it again.

(this is an adaption of someone elses code)

Dim db As Object
Dim rst As Object
Dim fldEnumerator As Object
Dim fldColumns As Object

Set db = CurrentDb()
Set rst = db.OpenRecordset("Log")
Set fldColumns = rst.Fields

While Not rst.EOF
For Each fldEnumerator In rst.Fields
If fldEnumerator.Name = "ID" Then
If fldEnumerator.Value = Forms!Log!ID Then
rst.Requery
End If
End If
Next
rst.MoveNext
Wend

Surely there is some way to get this to work correctly...
 
That's more or less right. When I click the record I have code that changes that record to a new one. After it is finished changing I want it to update but I dont want to requery the entire form because it will move me back to the first record. I can requery the column with Me.Status.Requery but when it requeries it takes it a few seconds for all the data to be displayed again. I would rather just requery the single record which is being clicked. The code above will do it but only on one click after that it wont for some reason.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom