define variable hOrderQuery as handle no-undo.
define variable browseOrder-hdl as handle no-undo.
define variable browse-hdl as handle no-undo.
define variable CNumber as integer no-undo.
CREATE QUERY hQuery.
hQuery:SET-BUFFERS(BUFFER Customer:HANDLE).
hQuery:QUERY-PREPARE("FOR EACH Customer").
hQuery:QUERY-OPEN().
CREATE BROWSE browse-hdl
ASSIGN
TITLE = "Customer Browser"
FRAME = FRAME MyFrame:HANDLE
QUERY = hQuery
X = 2
Y = 2
WIDTH = 74
DOWN = 10
VISIBLE = YES
SENSITIVE = TRUE
READ-ONLY = yes.
browse-hdl:ADD-COLUMNS-FROM(BUFFER Customer:HANDLE,"SalesRep,email,fax,comments,address,City,State,PostalCode").
on value-changed of browse-hdl
do:
FIND CURRENT Customer.
cNumber = Customer.CustNum.
CREATE QUERY hOrderQuery.
hOrderQuery:SET-BUFFERS(BUFFER Order:HANDLE).
hOrderQuery:QUERY-PREPARE("FOR EACH Order where Order.CustNum = " + string(cNumber)) no- error.
hOrderQuery:QUERY-OPEN().
CREATE BROWSE browseOrder-hdl
ASSIGN
TITLE = "Order Browser"
FRAME = FRAME MyFrame:HANDLE
QUERY = hOrderQuery
X = 2
Y = 240
WIDTH = 74
DOWN = 10
VISIBLE = YES
SENSITIVE = TRUE
READ-ONLY = yes.
browseOrder-hdl:ADD-COLUMNS-FROM(BUFFER Order:HANDLE,"warehousenum,CustNum").
end.
on value-changed of browseOrder-hdl
do:
message "hai" view-as alert-box.
end.
这是我的问题。我有 3 个浏览器。现在我只创建了两个。当我点击第一个客户浏览器的一行时,它应该选择当前客户并应该在第二个浏览器订单浏览器中显示他的订单。当我点击订单浏览器值时,它应该在第三个订单浏览器(我现在没有创建)中显示相应的订单表值。
因此,当我尝试使用 browseOrder-hdl 创建第二个值更改事件时,它显示它已被删除。如何克服这个问题?请回复。