|
Private Sub Command41_Click()
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
shuliang = "SELECT 订单明细.订单ID, 订单明细.数量 FROM 订单明细 GROUP BY 订单明细.订单ID, 订单明细.数量 HAVING (((订单明细.订单ID)='" & [Forms]![订单]![订单ID] & "'));"
rs.Open shuliang, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Do While Not rs.EOF
If IsNull(rs.Fields("数量")) = True Then
MsgBox "至少一条记录没有数量,请核对后保存", vbDefaultButton1
Exit Do '加上这一句,不然死循环
Else
rs.MoveNext
End If
Loop
Set rs = Nothing
Me.Command37.SetFocus
Me.Command41.Enabled = False
Call bukebianji
End Sub
[ 本帖最后由 glw 于 2008-2-16 17:49 编辑 ] |
|