Foxtable(狐表)用户栏目专家坐堂 → 求助~~~索引-1不是负数就是大于行数 问题~~


  共有12593人关注过本帖树形打印复制链接

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

帅哥哟,离线,有人找我吗?
zbsczh
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:15 积分:156 威望:0 精华:0 注册:2011/6/14 16:51:00
求助~~~索引-1不是负数就是大于行数 问题~~  发帖心情 Post By: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


 回到顶部
帅哥哟,离线,有人找我吗?
zbsczh
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:15 积分:156 威望:0 精华:0 注册:2011/6/14 16:51:00
  发帖心情 Post By:2011/6/20 16:48:00 [显示全部帖子]

汗,果真如此。。。

and andalso。。。


 回到顶部