供应商信息表 where 供应商编号 like +''%''+''" + txt1(0) + "''+''%''or 供应商全称 like +''%''+''" + txt1(0) + "''+''%''or 简称 like +''%''+''" + txt1(0) + "''+''%''"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
DataGrid1.Visible = True
DataGrid1.SetFocus
Else
Adodc1.RecordSource = "供应商信息表"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
DataGrid1.Visible = True
DataGrid1.SetFocus
Else
MsgBox "无可选的供应商信息,请首先录入供应商数据!", , "提示窗口"
End If
End If
End If
If KeyCode = vbKeyReturn And Index = 1 Then
flex1.Col = 1
flex1.Row = 1
flex1.SetFocus
End If
End Sub
Private Sub DataGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode =
vbKeyReturn Then
txt1(0) = Adodc1.Recordset.Fields("供应商全称")
txt1(1).SetFocus
DataGrid1.Visible = False
End If
End Sub
Private Sub txtEdit_KeyPress(KeyAscii As Integer)
''删除回车符,以消除嘟嘟声。
If KeyAscii = Asc(vbCr) Then KeyAscii = 0
End Sub
Private Sub txtEdit_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn And flex1.Col = 1 Then
Adodc2.RecordSource = "商品信息表 where 商品名称 like +''%''+''" + txtEdit + "''+''%''"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
DataGrid2.Visible = True
DataGrid2.SetFocus
Else
Adodc2.RecordSource = "商品信息表"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Th