|
Private Sub Incoming_Qty_AfterUpdate()
Dim conn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Set conn = CurrentProject.Connection
rst.CursorLocation = adUseClient
Dim co As String
Dim qty As Integer
rst.Open " select [A].[cust po] as co, [A].[QTY] as qty from [A] where ([A].[cust po]='" + Me.Cust_PO + "')", conn, adOpenStatic, adLockPessimistic
With rst
If Not rst.EOF Then
If IsNull(Me.Incoming_Qty) = False Then
If qty >= Me.Incoming_Qty Then
Me.Text18 = Me.Cust_PO
Me.Text20 = Me.Incoming_Qty
DoCmd.GoToRecord , , acNewRec
Me.Cust_PO = ""
Me.Incoming_Qty = ""
Else: MsgBox "数量超出"
Me.Text22 = qty
End If
Else: MsgBox "请输入数量"
End If
End If
End With
rst.Close
End Sub
哪位大侠帮我看看,为啥qty一直显示为0?谢谢! |
|