A
AkAlan via AccessMonster.com
I'm looking to restrict editing to the last record of a contiuous sub-form.
I've been playing with creating a recordset clone and moving to the next
record to check for EOF and setting allow edits as appropriate but I can't
seem to get it in the right event. I've tried the forms before update and
before insert but alway have issues. Does anyone have a good method for doing
this? Doesn't seem like it should be that difficult. Here is the code I run.
Thanks for any help
Dim rst As ADODB.Recordset
Set rst = Me.RecordsetClone
rst.MoveNext
If rst.EOF Then
Me.AllowEdits = True
Else
Me.AllowEdits = False
End If
rst.MovePrevious
Set rst = Nothing-
I've been playing with creating a recordset clone and moving to the next
record to check for EOF and setting allow edits as appropriate but I can't
seem to get it in the right event. I've tried the forms before update and
before insert but alway have issues. Does anyone have a good method for doing
this? Doesn't seem like it should be that difficult. Here is the code I run.
Thanks for any help
Dim rst As ADODB.Recordset
Set rst = Me.RecordsetClone
rst.MoveNext
If rst.EOF Then
Me.AllowEdits = True
Else
Me.AllowEdits = False
End If
rst.MovePrevious
Set rst = Nothing-