PROCEDURE Load
* Important for local views
Set Exclusive Off
* Need this for table buffering
Set MultiLocks On
Set Data To AppViews
* No data on load, please
Use vOrders NoData
* Set optimistic table buffering
CursorSetProp("Buffering", 5)
ENDPROC
PROCEDURE cmdfind.Click
PRIVATE cCustomerID
cCustomerID = ""
IF Thisform.PendingChanges()
WITH Thisform
.Lockscreen = .T.
IF Not Thisform.lFindMode
thisform.lFindMode = .T.
* Change to find mode
this.Caption = "\<Retrieve"
.SetAll("Enabled", .F., "textbox")
.SetAll("Enabled", .F., "_commandbutton")
.txtCustomerID.Enabled = .T.
.txtCustomerID.Setfocus()
ELSE && In find mode, so Retrieve
.SetAll("Enabled", .T., "textbox")
.SetAll("Enabled", .T., "_commandbutton")
this.Caption = "\<Find"
.txtCustomerID.Enabled = .F.
cCustomerID = .txtCustomerID.Value
Requery()
thisform.lFindMode = .F.
ENDIF
.cmdfind.Enabled = .T.
.txtOrderID.Enabled = .F.
.Refresh()
.Lockscreen = .F.
ENDWITH
ENDIF
ENDPROC
|