Project: Previous and Next Buttons in Form Not Recorded
  
PSS ID Number: Q113461
Article last modified on 09-18-1994
 
4.00
 
WINDOWS
 

--------------------------------------------------------------------
The information in this article applies to:
 
 - Microsoft Project for Windows, version 4.0
--------------------------------------------------------------------
 
SYMPTOMS
========
 
In Microsoft Project, if you turn on the macro recorder, and then use
the Previous or Next buttons in a form view, no command is recorded
for this action in the macro.
 
STATUS
======
 
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. We are researching this problem
and will post new information here in the Microsoft Knowledge Base as it
becomes available.
 
WORKAROUND
==========
 
If you want to use a macro to display the next or previous task or resource
in a form view, use the SendKeys statement to send the keystrokes to the
Form. For example, the following macro applies the Task Form view and views
the next task after the selected task:
 
   Sub Form_View()
     ' Send equivalent of ALT+E keys 2 times
     SendKeys "%e%e"
     ViewApply Name:="Task Form"
   End Sub
 
Note that you can still use the SetTaskField method in a macro to
make changes to a specified task, even if the current view is a form.
 
Microsoft provides examples of Visual Basic procedures for illustration
only, without warranty either expressed or implied, including but not
limited to the implied warranties of merchantability and/or fitness for a
particular purpose. This Visual Basic procedure is provided 'as is' and
Microsoft does not guarantee that it can be used in all situations.
Microsoft does not support modifications of this procedure to suit customer
requirements for a particular purpose. Note that a line that is preceded by
an apostrophe introduces a comment in the code--comments are provided to
explain what the code is doing at a particular point in the procedure. Note
also that an underscore character (_) indicates that code continues from
one line to the next. You can type lines that contain this character as one
logical line or you can divide the lines of code and include the line-
continuation character.
 
MORE INFORMATION
================
 
When you turn on the macro recorder and use the arrow keys to select a
field in a table view, the SelectTaskField method is recorded. However,
when you apply a form view and use the Next or Previous buttons to display
another task or resource, no command is recorded.
 
Steps to Reproduce Behavior
---------------------------
 
1. In a new project, enter three tasks, T1, T2, and T3. Select T1, and
   choose More Views from the Views menu. From the Views list, select Task
   Form and choose Apply.
 
2. From the Tools menu, choose Record Macro. In the Macro name box, type
   "Test" (without the quotation marks). Choose the Options button. Under
   Store Macro In, select the Current Project File option and choose OK.
 
3. In the Task Form, choose the Next button two times.
 
T3 should be displayed in the Name box.
 
4. From the Tools menu, choose Stop Recorder. From the Tools menu, choose
   Macros. From the Macro Name list, select Test and choose Edit.
 
Note that no commands were recorded in the macro.
 
REFERENCES
==========
 
For more information about the SelectTaskField method, choose the
Search button in the Visual Basic Reference and type:
 
   SelectTaskField
 
KBCategory: kbprb
KBSubcategory: kbmacro
 
Additional reference words: 4.00
=============================================================================
Copyright Microsoft Corporation 1994.
