GoToRecord Doesn't Work in SQL Linked Table

K

Kate Koun

I have linked SQL Orders and OrderItems tables. On an
order form, I am deleting a record from an orderitems
subform. The following code worked before I upsized to
SQL:

Private Sub Form_AfterDelConfirm(Status As Integer)
On Error GoTo err_Form_AfterDelConfirm

Dim LastRecordLineNum As Integer
Dim StartingRecordNum As Long

StartingRecordNum = Me.CurrentRecord

DoCmd.GoToRecord , , acLast
...

Now, when I reach the GoToRecord command I get a message
box saying "Can't go to specified record". I assume this
has something to do with having just deleted a record as
the command works find when inserting a record. Any ideas
on how I can get this functionality back?

Thanks
 
M

Michel Walsh

Hi,


Have you tried:



Sub MoveToTheLastRecord( )
With Me.RecordsetClone
.MoveLast
Me.Bookmark = .Bookmark
End With
End Sub



(don't miss the small dots, there is one before Movelast and one, more
visible, before the right Bookmark).



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top