By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,486 Members | 2,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,486 IT Pros & Developers. It's quick & easy.

Open Datasheet Form to Selected Record?

P: n/a
a2k (9.0.6926) SP-3 Jet 4.0 SP-7

I have a button on a Single Form that when pressed displays all the
underlying records in the table in a Datasheet Form.

For example, Northwind, Customer Table, say in Single Form, I'm on
Record ID 3, Antonio Moreno Taquería, when I press the Show All button
I want the Datsheet to open with all the records and Record ID 3
selected. (third one down from the top)

What is the code to make this happen?

Thanks, John
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Support4John wrote:
a2k (9.0.6926) SP-3 Jet 4.0 SP-7

I have a button on a Single Form that when pressed displays all the
underlying records in the table in a Datasheet Form.

For example, Northwind, Customer Table, say in Single Form, I'm on
Record ID 3, Antonio Moreno Taquería, when I press the Show All button
I want the Datsheet to open with all the records and Record ID 3
selected. (third one down from the top)

What is the code to make this happen?

Thanks, John


John,
You can easily re-open the form in Datasheet view, showing just the one
record:
DoCmd.OpenForm "FormName", acFormDS, , "[RecordID] = " & Me![RecordID]

But in addition to that you wish to show all the records. while having
focus on the selected one. You'll need to do it a bit differently.

DoCmd.OpenForm "FormName", acFormDS
Me![RecordID].SetFocus
DoCmd.FindRecord Me![RecordID]

How many actual records will be displayed depends upon the screen size
and the number of records in the database.
--
Fred
Please reply only to this newsgroup.
I do not respond to personal e-mail.
Nov 12 '05 #2

P: n/a
Thanks, worked perfectly
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.