Approach User Support homepage Approach User Support
Answers to Frequently Asked Questions about Lotus Approach
Examples LotusScripts
Example databases
Links to other Lotus Approach support services

[Return to contents]

Example LotusScript: Conditional Automatic Entry

Last updated: before December, 1998

'Written by Mr Rhodri Edwards, 1996
'(C) Copyright 1996 by Rhodri Edwards
'
'Permission is granted to freely copy this script in
'electronic form, 'or to print for personal use. It may be
'use in any Approach database, but may not be distributed
'for profit either by itself or as part of a collection or
'database.
'
'Disclaimer: This script is provided as is
'without any express or implied warranties.
'The author assumes no responsibility for errors or
'omissions, or for damages resulting from the use of the information contained
'herein.
'
'This script tests the value held within a text box and if it equals
'"Do it" assigns a value to 5 other fields and finishes by tabbing to
'another fieldbox.
 If CurrentView.Body.Field0.Text = "Do it" Then
      CurrentView.Body.Field1.Text = "Test1"
      CurrentView.Body.Field2.Text = "Test2"
      CurrentView.Body.Field3.Text = "Test3"
      CurrentView.Body.Field4.Text = "Test4"
      CurrentView.Body.Field5.Text = "Test5"
      CurrentView.Body.Field6.SetFocus
End If
'This example assumes that all the fields you want to set are not on a
'repeating panel.  If they are replace "Body" with "RepeatingPanel".
'
'Field* is where you would put the name of the fieldbox you want to
'set/move to.
'
'The script itself should be attached to the "LostFocus" event of
'field0 (i.e. the field the user fills in).
'
'One important thing to note is:
'
'SetFocus won't work if you are moving from a repeating panel to a body
'part of a form.  Instead the field you move to "hovers" in the top
'left hand corner of the screen.

[Return to contents]

© Copyright, JohnBrown, Trademarks, Disclaimer, Acknowledgements.