home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 November
/
Pcwk1197.iso
/
LOTUS
/
Eng-ins
/
SAMPLES
/
SUITE
/
DW08_S2.APR
/
SCRIPT
/
ApproachDoc
/
Employee
/
Body
/
btnID.s
(
.txt
)
< prev
next >
Wrap
Null Bytes Alternating
|
1996-10-27
|
4KB
|
51 lines
'++LotusScript Development Environment:2:5:(Options):0:66
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub Click(Source As Button, X As Long, Y As Long, Flags As Long)
'++LotusScript Development Environment:2:5:(Declarations):0:2
'++LotusScript Development Environment:2:2:BindEvents:1:129
Private Sub BindEvents(Byval Objectname_ As String)
Static Source As BUTTON
Set Source = Bind(Objectname_)
On Event Click From Source Call Click
End Sub
'++LotusScript Development Environment:2:2:Click:1:12
Sub Click(Source As Button, X As Long, Y As Long, Flags As Long)
'Click event for the btnID object.
'Applies the Find and Sort objects to the DocWindow
'using the FindSort method. It prompts the user to enter
'an employee's ID number and starts searching after the
'user enters the info.
' * RUNTIME DEPENDENCIES
' * Files: The main table for the current .APR must have
' * fields named "ID", "Last", and "First".
'Create a DocWindow object.
Dim MyDocWin As DocWindow
'Retrieve the active DocWindow.
Set MyDocWin = CurrentApplication.ActiveDocWindow
'Create a Table object.
Dim MyTable As String
'Retrieve the name of the main table for the view.
MyTable = CurrentDocument.Tables(0).TableName
'Collect user input for the find condition and create the find.
Dim Criteria As String 'Stores the user input
'Prompt user to enter employee's ID number
Criteria = Inputbox$("Enter employee's 5-digit ID:", , ,300,300)
'Create new instance of Find object with user's input
Dim FindID As New Find (MyTable & ".ID", Criteria)
'Create new instance of Sort object, sorted by last name
'The constant LtsSortAscending indicates the sort direction.
Dim MySort As New Sort (MyTable & ".Last", LTSSORTASCENDING)
'Also sort by first name in ascending order.
Call MySort.Add (MyTable & ".First", LTSSORTASCENDING)
'Start the find/sort.
'Add error handling here to check for finds that return no records.
Call MyDocWin.FindSort (FindID, MySort)
End Sub 'Click event for btnID