Office中國(guó)論壇/Access中國(guó)論壇

 找回密碼
 注冊(cè)

QQ登錄

只需一步,快速開始

返回列表 發(fā)新帖
查看: 1377|回復(fù): 1
打印 上一主題 下一主題

[ADO/DAO] 求救,哪位大俠能幫我看看問題出在哪兒?jiǎn)?/span>

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
1#
發(fā)表于 2010-1-26 15:55:48 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
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 "數(shù)量超出"
                                                                 Me.Text22 = qty
                                                                 
                                                           End If
                                       
                   Else: MsgBox "請(qǐng)輸入數(shù)量"
                   End If
End If
End With
rst.Close
End Sub

哪位大俠幫我看看,為啥qty一直顯示為0?謝謝!
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享分享 分享淘帖 訂閱訂閱
2#
發(fā)表于 2010-1-26 17:34:24 | 只看該作者
沒賦值當(dāng)然默認(rèn)為0
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則

QQ|站長(zhǎng)郵箱|小黑屋|手機(jī)版|Office中國(guó)/Access中國(guó) ( 粵ICP備10043721號(hào)-1 )  

GMT+8, 2024-10-23 10:22 , Processed in 0.097234 second(s), 25 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回復(fù) 返回頂部 返回列表