见代码
Private Sub Command2_Click()
Dim mydb As Database, myset As Recordset
If ([Combo5] = "" Or IsNull(Combo5)) Then
MsgBox "请选择物料代码!"
[Combo5].SetFocus
Exit Sub
End If
On Error Resume Next
Set mydb = DBEngine.Workspaces(0).Databases(0)
Set myset = mydb.OpenRecordset("select on_hand_qty from dbo_inv_stock_detail_v where dbo_inv_stock_detail_v.item_code='&[combo5]&' and dbo_inv_stock_detail_v.warehouse='&A01&'")
If Not (IsNull(myset!on_hand_qty)) Then
Forms![stock]![Text11] = myset!on_hand_qty
End If
myset.Close
Set myset = mydb.OpenRecordset("select on_hand_qty from dbo_inv_stock_detail_v where dbo_inv_stock_detail_v.item_code='&[combo5]&' and dbo_inv_stock_detail_v.warehouse='&A02&'")
If Not (IsNull(myset!on_hand_qty)) Then
Forms![stock]![Text13] = myset!on_hand_qty
End If
myset.Close
Set myset = mydb.OpenRecordset("select on_hand_qty from dbo_inv_stock_detail_v where dbo_inv_stock_detail_v.item_code='&[combo5]&' and dbo_inv_stock_detail_v.warehouse='&A03&'")
If Not (IsNull(myset!on_hand_qty)) Then
Forms![stock]![Text15] = myset!on_hand_qty
End If
myset.Close
Set myset = mydb.OpenRecordset("select on_hand_qty from dbo_inv_stock_detail_v where dbo_inv_stock_detail_v.item_code='&[combo5]&' and dbo_inv_stock_detail_v.warehouse='&A04&'")
If Not (IsNull(myset!on_hand_qty)) Then
Forms![stock]![Text17] = myset!on_hand_qty
End If
myset.Close
End Sub
记录集中有结果但窗体的文本框中没有任何显示,请问原因
[此贴子已经被lihao6于2002-5-31 16:19:14编辑过]
|