listbox on tab control to update mainform recordset using ADO

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

mattcannen via AccessMonster.com

Hi all,

Access Newbie here with I'm sure is an easily answered question. I have
a form that has a tab control with a listbox called lstVacations. What iam
attempting to do is click a record in my listbox that navigates to the
selected record on my mainform. Below is the code that I am trying to use
with no luck. I dont receive any errors but I am unable to navigate to the
record in the main forms record set.


Private Sub lstVacations_AfterUpdate()
Dim rst As ADODB.Recordset
Dim strSearchName As Integer

Set rst = rsVacRequest.Clone ' this is the recordset for the main form
Dim mark As Variant
strSearchName = CInt(Me.lstVacations.Column(8))
rst.Find "[intTimeOffId] = " & strSearchName
mark = rst.Bookmark
rst.Close

End Sub
 
M

mattcannen via AccessMonster.com

Ok this is what i have been able to figure out so far. For some reason my
main form still doesnt update.
Dim rst As ADODB.Recordset
Dim strSearchName As Integer
Dim varBookmark As Variant
Dim varBookmark1 As Variant

Set rst = rsVacRequest.Clone ' this is the recordset for the main form

varBookmark = rsVacRequest.Bookmark

strSearchName = CInt(Me.lstVacations.Column(8))
rst.MoveFirst
rst.Find "[intTimeOffId] = " & strSearchName
If rst.EOF Then
MsgBox "Not Found Sucka!"
Else
varBookmark = rst.Bookmark
End If
varBookmark = rst.Bookmark
MsgBox varBookmark
MsgBox rst.Bookmark
rst.Close

End Sub
 

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