Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:求助~~~索引-1不是负数就是大于行数 问题~~

1楼
zbsczh 发表于:2011/6/20 16:27:00

求助。。

不知道为什么在点击出库窗口-保存的时候,老是出这个错。。

条件是物料号在库存里不存在的时候

 

代码我调试过,定位的差不多是下面一段。

谁能帮我解答一下,谢谢

 

 With Tables("库存")
                                                                        Dim flag As Integer
                                                                        flag = .Find(cstr(m1),0,"物料号",False,True,True)
                                                                        If flag > -1 And .Rows(flag)("可用库存") >= quantity Then
                                                                            .Rows(flag)("可用库存") = .Rows(flag)("可用库存") - quantity
                                                                            .Rows(flag)("当前库存") = .Rows(flag)("当前库存") - quantity
                                                                            '.Rows(flag)("库存总价") = .Rows(flag)("库存总价") + amount
                                                                           
                                                                            With Tables("出库")
                                                                                If .Current IsNot Nothing Then
                                                                                    .Current.Locked = True
                                                                                End If
                                                                            End With
                                                                        ElseIf flag > -1 And .Rows(flag)("可用库存") < quantity Then
                                                                            e.Cancel = True
                                                                            Messagebox.Show("   实领数量不能大于可用库存数量!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
                                                                        Else
                                                                            e.Cancel = True
                                                                            Messagebox.Show("   当前输入的物料号在库存中不存在,请输入正确的物料号!", "提示", MessageBoxButtons.OK,MessageBoxIcon.Information)
                                                                        End If
                                                                    End With

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:仓库管理模板_20110609.table

2楼
狐狸爸爸 发表于:2011/6/20 16:33:00

参考下面的:

 

http://help.foxtable.com/topics/1485.htm

 

看看问题出在哪一行。

3楼
狐狸爸爸 发表于:2011/6/20 16:36:00

注意:

 

ElseIf flag > -1 And .Rows(flag)("可用库存") < quantity Then

 

应该改为:

 

ElseIf flag > -1 AndAlso .Rows(flag)("可用库存") < quantity Then

 

类似的全部改!!!

4楼
zbsczh 发表于:2011/6/20 16:48:00

汗,果真如此。。。

and andalso。。。

共4 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03516 s, 3 queries.