goto specific record

moddien

Registered User.
Local time
Today, 15:25
Joined
May 21, 2008
Messages
11
Hi guys,

want to switch between several forms. To go to the specific record I use this code:

Code:
Private Sub GoConfirmation_Click()
Dim strwhere As String
strwhere = "[MBS Ref] = """ & Me.[MBS Ref] & """"
 
DoCmd.Close acForm, "Edit"
DoCmd.OpenForm "Confirmation", acNormal, "", strwhere, acReadOnly, acNormal
 
End Sub

the problem is that the record is now fixed and i am not able to switch between other records...so the filter or where - restriction must be removed after matching the record.

Maybe there is another solution to take the current record to another form. many thanks in advance..

Cheers Martin
 
Have you tried putting a button labeled "Show All Records' and use it to turn the 'allow filters' property off?
 
when i do this it jumps back to the first record...and that is what i dont want :-(
 
Hi,

When you specify the "where" argument in your openform command you are returning only the records which match that argument.

What you can do is open the form without specify the "where" argument and then use the docmd.gotorecord to go to the record you wish.
 
Use the "Openargs" to pass the data for the record you want to go to.

Now make some code in the "On Open" event to search for the record in your recordset

Dim rs as dao.recordset
set rs = me.recordsetclone
rs.findfirst where key = OpenArgs
me.bookmark = rs.bookmark
rs.close
set rs=nothing

DONE.
 

Users who are viewing this thread

Back
Top Bottom