标题:DataGrid无法返回
只看楼主
sncelpl
Rank: 1
等 级:新手上路
帖 子:87
专家分:0
注 册:2006-6-28
结帖率:86.67%
已结贴  问题点数:2 回复次数:1 
DataGrid无法返回
  If now_add Then
        old = RS.Bookmark
        For i = 0 To 53
            Text1(i).Locked = False
        Next
        Toolbar1.Buttons(6).Caption = "确定"
        Toolbar1.Buttons(7).Caption = "取消"
        For i = 1 To 5
            Toolbar1.Buttons(i).Enabled = False
        Next
        Command1.Visible = True
        For i = 0 To 27
            Label8(i).Visible = True
        Next
        Toolbar1.Buttons(8).Enabled = False
        Toolbar1.Buttons(9).Enabled = False
    Else
        RS.CancelUpdate
        RS.Bookmark = old
        Toolbar1.Buttons(6).Caption = "添加"
        Toolbar1.Buttons(7).Caption = "更新"
        Command1.Visible = False
        For i = 1 To 5
            Toolbar1.Buttons(i).Enabled = True
        Next
        Toolbar1.Buttons(8).Enabled = True
        Toolbar1.Buttons(9).Enabled = True
        For i = 0 To 53
            Text1(i).Locked = True
        Next
        For i = 0 To 27
            Label8(i).Visible = False
        Next
    End If
    now_add = Not now_add
    Exit Sub
我点取消DataGrid无法返回好象RS.CancelUpdate       RS.Bookmark = old这两个没执行。数据卡在新建行动不了
另一个窗体正常代码是一样的

[此贴子已经被作者于2022-5-16 12:10编辑过]

搜索更多相关主题的帖子: 返回 DataGrid False For Next 
2022-05-16 10:20
yuma
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:银河系
等 级:贵宾
威 望:33
帖 子:1883
专家分:2904
注 册:2009-12-22
得分:2 
要写成这样

函数写成这样才会有返回值:

Function xxx()
.......
End Function

心生万象,万象皆程序!
本人计算机知识网:http://bbs.为防伸手党,本站已停止会员注册。
2022-05-16 13:54



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-509088-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.084354 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved