Opening form without filtering records

Hi,

I have a form with a subform that feeds off the same table.  I'd like the user to be able to click a button in the subform and have the main form jump to that record.

When I try this using the wizard, the main form jumps to the desired record just fine, but it is filtered.  Is there a way to code this so my users don't end up in a one-way street?  Put another way, is there a way to leave the main form at the desired record and still have the navigation buttons work properly?

Thanks!
hrufescensAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
my bad... my mistake

use this

Private Sub Elev_DblClick(Cancel As Integer)
    With Me.Parent.RecordsetClone
        .FindFirst  "[ID_Room]= " & Me.[ID_Room]
        If Not .NoMatch Then Me.Parent.Bookmark = .Bookmark
    End With
End Sub
0
 
Rey Obrero (Capricorn1)Commented:
alter your codes to use FindFirst instead of filtering the form


post the codes that you are using
0
 
hrufescensAuthor Commented:
Hi capricorn1,

Code I'm using is the standard wizard output.

I get your comment- can you hold my hand on syntax?  Something like

recordset.FindFirst  <blahblahblah>

where blahblahblah matches two fields:  ID_Room on the parent form and ID_Room on the subform.

Thanks
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Rey Obrero (Capricorn1)Commented:

     with me.parent.recordsetclone
            .findfirst ="[ID_Room]= " & me.[ID_Room]
            if not .nomatch then me.parent.bookmark=.bookmark


     end with
0
 
hrufescensAuthor Commented:
Had a problem:
Run-time error '3251' Operation is not supported for this type of object

on this statement:
.FindFirst = "[ID_Room]= " & Me.[ID_Room]
0
 
Rey Obrero (Capricorn1)Commented:
post the whole code.
where are you calling the codes from?

you can not identify where the problem is, by just posting a part of the codes
0
 
hrufescensAuthor Commented:
Calling this code on double-click [event procedure].
Option Compare Database
 
Private Sub Elev_DblClick(Cancel As Integer)
    With Me.Parent.RecordsetClone
        .FindFirst = "[ID_Room]= " & Me.[ID_Room]
        If Not .NoMatch Then Me.Parent.Bookmark = .Bookmark
    End With
End Sub

Open in new window

0
 
Rey Obrero (Capricorn1)Commented:
can you attach your db. check attach file below
0
 
hrufescensAuthor Commented:
Sure- I'll have to un-split it and shrink it a bit.  Hold on..
0
 
hrufescensAuthor Commented:
Here it is, boiled down to the tables/forms in question. Thanks...
GapDB-excerpt.mdb
0
 
hrufescensAuthor Commented:
Thank you capricorn1- works great.  You're awesome!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.