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.