Link to home
Start Free TrialLog in
Avatar of hrufescens
hrufescens

asked on

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!
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

alter your codes to use FindFirst instead of filtering the form


post the codes that you are using
Avatar of hrufescens
hrufescens

ASKER

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

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


     end with
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]
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
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

can you attach your db. check attach file below
Sure- I'll have to un-split it and shrink it a bit.  Hold on..
Here it is, boiled down to the tables/forms in question. Thanks...
GapDB-excerpt.mdb
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you capricorn1- works great.  You're awesome!