Private Sub customername_Change()
Set rs = cndb.Execute("select * from customer where cusname like '" & cusname.Text & "%'")
Set Grid1.DataSource = rs
Call hgrid
End Sub
Private Sub Form_Load()
Set rscus = cndb.Execute("select * from customer where status=0 order by cuscode")
Set Grid1.DataSource = rscus
Call hgrid
End Sub
Sub hgrid()
With Grid1
.TextMatrix(0, 1) = "id"
.TextMatrix(0, 2) = "name"
.ColWidth(0) = 200
.ColWidth(1) = 900
.ColAlignmentFixed(1) = 3
.ColAlignmentFixed(2) = 3
End With
End Sub
Private Sub Grid1_DblClick()
If ccc = 1 Then
frmsale.cusname.Text = Grid1.TextMatrix(Grid1.Row, 3)
ccc = 0
Unload Me
frmsale.tname.SetFocus
End If
End Sub
|