Open a form to a specific record without a filter

A

accesswanabe

Is there a way to open a form to a specific record whose recordsource is set
to a multiple record recordset without using a filter? I don't want to use a
filter because I'd like the user to be able to navigate through the entire
recordset without turning filters on and off. I'm currently using a
technique that opens the form and then syncs to a bookmark. This has the
effect of showing the user an initial incorrect record that advances to the
correct record which is quick, but looks sloppy...I'd like the user to not
see this effect. Any ideas would be very much appreciated!

Thanks much!
 
A

Albert D. Kallal

I use the folwling code, and I don't see the forms first record flash by.

to open the form, I simply "pass" the ID value such as:


DoCmd.OpenForm "main", , , , , , Me!ID

In the forms open event (which is early, and comes before the on-load even),
I go:

Private Sub Form_Open(Cancel As Integer)

If IsNull(Me.OpenArgs) = False Then

Me.Recordset.FindFirst "id = " & Me.OpenArgs

End If

End Sub

The above does not even flicker, or show the original record.....

Perhaps you code is not in the on open...and runs a bit later????

Give the above idea a a try. The forms "open" event runs most everything
BEFORE the form will even display.....
 
D

Dan Cox

I had the same question until I read this conversation.

However, the form I would like to open (after the double click) is a split form. It successfully navigates to the specified record on the continuous part of the form (without filtering the records :)) but it doesn't go to the specified record in the datasheet section.

Is there a way to fix this?

Hope you can help, and thank you for the above code!



accesswanab wrote:

Thanks Albert...very good advice. I really appreciate it."Albert D.
22-Mar-09

Thanks Albert...very good advice. I really appreciate it

:

Previous Posts In This Thread:

Open a form to a specific record without a filter
Is there a way to open a form to a specific record whose recordsource is set
to a multiple record recordset without using a filter? I don't want to use a
filter because I'd like the user to be able to navigate through the entire
recordset without turning filters on and off. I'm currently using a
technique that opens the form and then syncs to a bookmark. This has the
effect of showing the user an initial incorrect record that advances to the
correct record which is quick, but looks sloppy...I'd like the user to not
see this effect. Any ideas would be very much appreciated

Thanks much!

I use the folwling code, and I don't see the forms first record flash by.
I use the folwling code, and I don't see the forms first record flash by

to open the form, I simply "pass" the ID value such as

DoCmd.OpenForm "main", , , , , , Me!I

In the forms open event (which is early, and comes before the on-load even)
I go

Private Sub Form_Open(Cancel As Integer

If IsNull(Me.OpenArgs) = False The

Me.Recordset.FindFirst "id = " & Me.OpenArg

End I

End Su

The above does not even flicker, or show the original record....

Perhaps you code is not in the on open...and runs a bit later???

Give the above idea a a try. The forms "open" event runs most everything
BEFORE the form will even display....

--
Albert D. Kallal (Access MVP
Edmonton, Alberta Canad
(e-mail address removed)

Thanks Albert...very good advice. I really appreciate it."Albert D.
Thanks Albert...very good advice. I really appreciate it

:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Professional Active Server Pages 3.0 (Wrox)
http://www.eggheadcafe.com/tutorial...4-b4ea9b62129e/professional-active-serve.aspx
 

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