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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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
Rey Obrero (Capricorn1)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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hrufescensAuthor Commented:
Thank you capricorn1- works great.  You're awesome!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.