Talk About Network

Google





Software > Access Forms > Re: Go to last ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 4 Topic 44671 of 46786
Post > Topic >>

Re: Go to last record (Access 2003)

by "Ken Snell \(MVP\)" <kthsneisllis9@[EMAIL PROTECTED] > Aug 8, 2008 at 12:32 PM

Try this:

Private Sub LastQuestion_Click()
On Error GoTo Err_LastQuestion_Click

Dim varBookMark As Variant

With Me.RecordsetClone
    .MoveLast
    Do While Len(Me.TopicNameFieldName.Value) = 0
        .Move -1
    Loop
    varBookMark = .Bookmark
End With

Me.Bookmark = varBookmark

Me.monyrtm.SetFocus

Exit_LastQuestion_Click:
Exit Sub

Err_LastQuestion_Click:
MsgBox Err.Description
Resume Exit_LastQuestion_Click

End Sub

-- 

        Ken Snell
<MS ACCESS MVP>



"Carlos1815" <Carlos1815@[EMAIL PROTECTED]
> wrote in message 
news:b5b9e93c-65b5-413f-b8ff-909251ae3ce9@[EMAIL PROTECTED]
> Hello! I have a form with a default view of Continuous Forms.
> Basically, I have a list of 18 text boxes that a user can enter up to
> 18 topic names. I also made a set of command buttons for navigation:
> First, Next, Prev, and Last, so the user can navigate up and down the
> list of topic names. The nav buttons work, except for the Last button,
> I have it set to go to the last record using:
>
> '******************************************
> Private Sub LastQuestion_Click()
> On Error GoTo Err_LastQuestion_Click
>
> DoCmd.GoToRecord , , acLast
>
> Me.monyrtm.SetFocus
>
> Exit_LastQuestion_Click:
> Exit Sub
>
> Err_LastQuestion_Click:
> MsgBox Err.Description
> Resume Exit_LastQuestion_Click
>
> End Sub
>
> But, all 18 topic name text boxes won't always be filled, so I'd like
> the Last button to go to the last topic name created instead of just
> the last (18th) record. This seems like a simple problem, but I'm
> having a tough time trying to figure it out. Any help would be
> appreciated. Thanks!!
>
> Carlos
 




 4 Posts in Topic:
Go to last record (Access 2003)
Carlos1815 <Carlos1815  2008-08-08 07:39:45 
Re: Go to last record (Access 2003)
"Jeff Boyce" &l  2008-08-08 09:17:29 
Re: Go to last record (Access 2003)
"Ken Snell \(MVP\)&q  2008-08-08 12:32:46 
Re: Go to last record (Access 2003)
Carlos1815 <Carlos1815  2008-08-08 09:43:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 14:54:43 PST 2009.