Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Control record displayed in DataForm window

The Excel data/form window facilitates entering data when the fields in
a record extend over more than the width of the display screen.

The VBA command, "dataform," opens the data form window, but it always
displays the top record on the sheet. Once it is open, you can then
manually scroll down to any record on the sheet. Is there any way to
control which record it displays on opening in Excel95 or Excel97 other
than reordering the sheet so that the record of interest is at the top
of the sheet?

Michael in Los Angeles

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Control record displayed in DataForm window

You could use send keys:

SendKeys "{DOWN " & ActiveCell.Row - 2 & "}"
Application.DisplayAlerts = False
ActiveSheet.ShowDataForm
Application.DisplayAlerts = True


This will start the dataform on the row with the activecell.

Replace activecell.row with the number of the row you want to start on.

buczacz wrote:

The Excel data/form window facilitates entering data when the fields in
a record extend over more than the width of the display screen.

The VBA command, "dataform," opens the data form window, but it always
displays the top record on the sheet. Once it is open, you can then
manually scroll down to any record on the sheet. Is there any way to
control which record it displays on opening in Excel95 or Excel97 other
than reordering the sheet so that the record of interest is at the top
of the sheet?

Michael in Los Angeles


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Control record displayed in DataForm window

I could not get the code you suggested to work.
I could not find a way to specify the number of down keystrokes.
Instead I used:

NDX = 1: Do While NDX < IDN: SendKeys "{down}": NDX = NDX + 1: Loop
Application.DisplayAlerts = False
ActiveSheet.ShowDataForm
Application.DisplayAlerts = True

Where IDN (Identification Number) is the number of the desired row to
which I want to scroll.

Could the problem be that I'm currently running it in Excel95?
Thanks for the hint.

Michael



Dave Peterson wrote:
You could use send keys:

SendKeys "{DOWN " & ActiveCell.Row - 2 & "}"
Application.DisplayAlerts = False
ActiveSheet.ShowDataForm
Application.DisplayAlerts = True


This will start the dataform on the row with the activecell.

Replace activecell.row with the number of the row you want to start on.

buczacz wrote:

The Excel data/form window facilitates entering data when the fields in
a record extend over more than the width of the display screen.

The VBA command, "dataform," opens the data form window, but it always
displays the top record on the sheet. Once it is open, you can then
manually scroll down to any record on the sheet. Is there any way to
control which record it displays on opening in Excel95 or Excel97 other
than reordering the sheet so that the record of interest is at the top
of the sheet?

Michael in Los Angeles




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Control record displayed in DataForm window

Instead of using sendkeys within your loop, just figure out how many and pass
that number to it:

SendKeys "{DOWN " & NDX - 2 & "}"

But I'm not sure how you determined how many to come down, either.



buczacz wrote:

I could not get the code you suggested to work.
I could not find a way to specify the number of down keystrokes.
Instead I used:

NDX = 1: Do While NDX < IDN: SendKeys "{down}": NDX = NDX + 1: Loop
Application.DisplayAlerts = False
ActiveSheet.ShowDataForm
Application.DisplayAlerts = True

Where IDN (Identification Number) is the number of the desired row to
which I want to scroll.

Could the problem be that I'm currently running it in Excel95?
Thanks for the hint.

Michael

Dave Peterson wrote:
You could use send keys:

SendKeys "{DOWN " & ActiveCell.Row - 2 & "}"
Application.DisplayAlerts = False
ActiveSheet.ShowDataForm
Application.DisplayAlerts = True


This will start the dataform on the row with the activecell.

Replace activecell.row with the number of the row you want to start on.

buczacz wrote:

The Excel data/form window facilitates entering data when the fields in
a record extend over more than the width of the display screen.

The VBA command, "dataform," opens the data form window, but it always
displays the top record on the sheet. Once it is open, you can then
manually scroll down to any record on the sheet. Is there any way to
control which record it displays on opening in Excel95 or Excel97 other
than reordering the sheet so that the record of interest is at the top
of the sheet?

Michael in Los Angeles




--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control on a form to find a record Terry Excel Discussion (Misc queries) 2 September 7th 08 03:04 PM
how files are displayed in the open file window Brett Excel Discussion (Misc queries) 4 February 21st 08 08:51 PM
Getting control toolbox button to record a macro. suek Excel Discussion (Misc queries) 2 October 19th 07 12:02 AM
Function to control how data displayed LOgle5318 Excel Discussion (Misc queries) 1 August 25th 05 12:26 AM
window control Dave B[_3_] Excel Programming 2 August 21st 03 11:30 PM


All times are GMT +1. The time now is 11:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"