ADO listbox form navigation issue.

  • Thread starter matt mattcannen via AccessMonster.com
  • Start date
M

matt mattcannen via AccessMonster.com

This is a repost as I am down to my last hair on my head.

I am using a listbox on a tab control on my mainform that has alisting of
all records associated with form main record. when I select the record in
the list box that I want to navigate to. my form does not update. Using
the watch tool I can see that it is finding the record. Below is the code I
am using.

Private Sub lstVacations_AfterUpdate()
Dim rs As ADODB.Recordset
Dim intCurVacRequest As Integer
Dim mark As Variant

Set rs = rsVacRequest.Clone 'This is record set for main form
intCurVacRequest = CInt(Me.lstVacations.Column(8))

Do While Not rs.EOF
'MsgBox rs.Fields(0).Value
' MsgBox rs!intTimeOffId
rs.MoveNext
Loop

rs.MoveFirst
rs.Find "[intTimeOffId] = " & intCurVacRequest
mark = rs.Bookmark
rs.Bookmark = mark
Exit Sub

End Sub
 
M

matt mattcannen via AccessMonster.com

I had tried that option in the past but to no avail. You are correct that
I am using an MDB but this mdb has no tables only using it for forms. Why
am I doing that you may ask and the reason is much to long to explain here.
But when I try to set rs = me.recordsetclone I get the error invalid
reference to recordsetclone property.
 
M

Mark Phillipson

OK - The following I think is incorrect:

mark = rs.Bookmark
rs.Bookmark = mark

Perhaps it should be:

mark = rs.Bookmark
rsVacRequest.Bookmark = mark

Otherwise you are just moving rs to the row it is already on. Hope this
makes sence.

And you don't need the loop either.
--
HTH

Mark Phillipson

Free Add-Ins at; http://mphillipson.users.btopenworld.com/
 
M

matt mattcannen via AccessMonster.com

hmm app still isnt working correctly would it be possible to email you a
zipfile of the app?
 

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