| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1891 人关注过本帖, 2 人收藏
标题:表单新增、修改、删除操作示例
只看楼主 加入收藏
陶然愚者
Rank: 1
等 级:新手上路
帖 子:151
专家分:8
注 册:2012-12-13
收藏
得分:0 
回复 楼主 sdta
谢谢“sdta”版主!
仔细研读了实例中的原代码,总觉还不是自己想要的效果。不过在其中还是学到了很多非常实用的方法,特别是一些过程的控制和函数的使用,受益非浅。再次感谢。

再有一个问题:如版主提供的实例中,想改为上部为某同学的基本信息,下部表格中则是该同学的家庭成员信息,即两部分分别对应两个不同的数据表,从而实现对学生及其家庭成员相关信息在同一界面进行浏览、修改、添加或删除操作,不知该如何实现?
2012-12-14 09:31
stone1930
Rank: 1
等 级:新手上路
帖 子:12
专家分:1
注 册:2012-11-30
收藏
得分:0 
好东西,感谢分享!
2012-12-17 09:51
Q_Q老公
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-12-23
收藏
得分:0 
你好!我是个新手
我也不会VF
但是我想学,只因工作太无聊,自己有很多空余时间,
你的这个表单我运行了,可是我不懂里面的代码,
请问有没有你这个表单的有关于注释啊什么的,我想看看
因为实在看不懂
2012-12-27 15:35
罗建伟
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2014-3-1
收藏
得分:0 
"求助"vfp报表问题
我是个vfp初学者,现有个代码要改下,请教高手我该如何更改,感谢,感谢了!
修改要求:在打印此标签时,只允许打印第一个字段名为"H"的字段,当遇到字段为"001"或者"H239" 时不允许打印,
标签报表原代码如下:

LOCAL lc_id_chpdd_m , lc_i, lc_mod, sql_tmp1



TEXT TO sql_tmp1 NOSHOW
    select top 0  c.pingm, c.pingm_bh, c.pcs_lpsh, c.banh, c.dw, a.shul_jh, a.shul_bp, c.liaoh,  b.chpdd_bh, f.keh_po, e.bum1_yj, d.keh_bh, chpdd_mc5, a.id_chpdd_m, f.dind_bh
        from btr_chpdd_m a
            left outer join btr_chpdd_b b on a.id_chpdd_b = b.id_chpdd_b
            left outer join bmt_pingm c on a.id_pingm = c.id_pingm
            left outer join btr_dind_m e on a.id_dind_m = e.id_dind_m
            left outer join btr_dind_b f on e.id_dind_b = f.id_dind_b
            left outer join bmt_keh_g d on b.id_keh = d.id_keh and b.id_group = d.id_group
ENDTEXT

IF USED("Pr_my_tr_chpdd_fm_m1")
    SELECT Pr_my_tr_chpdd_fm_m1
    USE
ENDIF

IF (SQLEXEC(myconnect,sql_tmp1,'Pr_my_tr_chpdd_fm_m1') <= 0)
    WAIT WINDOW "通知单表明细取数不成功!" NOWAIT
    RETURN
ELSE
    SELECT Pr_my_tr_chpdd_fm_m1
ENDIF

SELECT Pr_My_tr_chpdd_fm_m
    GO TOP
SCAN
    lc_id_chpdd_m = ALLTRIM(id_chpdd_m)
    lc_dw = ALLTRIM(dw)
    lc_pingm = ALLTRIM(pingm)
    lc_keh_po = ALLTRIM(keh_po)
    lc_bum1_yj = ALLTRIM(bum1_yj)
    lc_liaoh = ALLTRIM(liaoh)
    lc_pingm_bh = ALLTRIM(pingm_bh)
    lc_dind_bh = ALLTRIM(dind_bh)
    lc_chpdd_mc5 = VAL(ALLTRIM(chpdd_mc5))
    lc_i = CEILING((shul_jh+shul_bp)/IIF(VAL(ALLTRIM(chpdd_mc5))>0,VAL(ALLTRIM(chpdd_mc5)),(shul_jh+shul_bp)))
    lc_mod = mod((shul_jh+shul_bp),IIF(VAL(ALLTRIM(chpdd_mc5))>0,VAL(ALLTRIM(chpdd_mc5)),(shul_jh+shul_bp)))
    FOR i=1 TO  lc_i
        SELECT Pr_My_tr_chpdd_fm_m1
            APPEND BLANK
            REPLACE NEXT 1 dw WITH lc_dw,;
                        id_chpdd_m WITH lc_id_chpdd_m,;
                        pingm WITH lc_pingm,;
                        dind_bh WITH lc_dind_bh,;
                        bum1_yj WITH lc_bum1_yj,;
                        keh_po WITH lc_keh_po,;
                        liaoh WITH lc_liaoh,;
                        pingm_bh WITH lc_pingm_bh,;        
                        shul_jh WITH IIF(i=lc_i AND lc_mod>0,lc_mod,lc_chpdd_mc5)
    ENDFOR
    SELECT Pr_My_tr_chpdd_fm_m
ENDSCAN  

IF Pr_My_tr_chpdd_fm_b.keh_bh='H239'
    MESSAGEBOX("标签格式不正确!请重新选择“001客户或H239客户标签”!!!","")
    SELECT Pr_My_tr_chpdd_fm_m1
    ZAP
ENDIF

SELECT Pr_My_tr_chpdd_fm_m1
this.InitialSelectedAlias = "Pr_My_tr_chpdd_fm_m1"
2014-03-13 13:54
罗建伟
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2014-3-1
收藏
得分:0 
求助,vfp标签代码问题
我是个vfp初学者,现有个代码要改下,请教高手我该如何更改,感谢,感谢了!
修改要求:在打印此标签时,只允许打印第一个字段名为"H"的字段,当遇到字段为"001"或者"H239" 时不允许打印,
标签报表原代码如下:

LOCAL lc_id_chpdd_m , lc_i, lc_mod, sql_tmp1



TEXT TO sql_tmp1 NOSHOW
    select top 0  c.pingm, c.pingm_bh, c.pcs_lpsh, c.banh, c.dw, a.shul_jh, a.shul_bp, c.liaoh,  b.chpdd_bh, f.keh_po, e.bum1_yj, d.keh_bh, chpdd_mc5, a.id_chpdd_m, f.dind_bh
        from btr_chpdd_m a
            left outer join btr_chpdd_b b on a.id_chpdd_b = b.id_chpdd_b
            left outer join bmt_pingm c on a.id_pingm = c.id_pingm
            left outer join btr_dind_m e on a.id_dind_m = e.id_dind_m
            left outer join btr_dind_b f on e.id_dind_b = f.id_dind_b
            left outer join bmt_keh_g d on b.id_keh = d.id_keh and b.id_group = d.id_group
ENDTEXT

IF USED("Pr_my_tr_chpdd_fm_m1")
    SELECT Pr_my_tr_chpdd_fm_m1
    USE
ENDIF

IF (SQLEXEC(myconnect,sql_tmp1,'Pr_my_tr_chpdd_fm_m1') <= 0)
    WAIT WINDOW "通知单表明细取数不成功!" NOWAIT
    RETURN
ELSE
    SELECT Pr_my_tr_chpdd_fm_m1
ENDIF

SELECT Pr_My_tr_chpdd_fm_m
    GO TOP
SCAN
    lc_id_chpdd_m = ALLTRIM(id_chpdd_m)
    lc_dw = ALLTRIM(dw)
    lc_pingm = ALLTRIM(pingm)
    lc_keh_po = ALLTRIM(keh_po)
    lc_bum1_yj = ALLTRIM(bum1_yj)
    lc_liaoh = ALLTRIM(liaoh)
    lc_pingm_bh = ALLTRIM(pingm_bh)
    lc_dind_bh = ALLTRIM(dind_bh)
    lc_chpdd_mc5 = VAL(ALLTRIM(chpdd_mc5))
    lc_i = CEILING((shul_jh+shul_bp)/IIF(VAL(ALLTRIM(chpdd_mc5))>0,VAL(ALLTRIM(chpdd_mc5)),(shul_jh+shul_bp)))
    lc_mod = mod((shul_jh+shul_bp),IIF(VAL(ALLTRIM(chpdd_mc5))>0,VAL(ALLTRIM(chpdd_mc5)),(shul_jh+shul_bp)))
    FOR i=1 TO  lc_i
        SELECT Pr_My_tr_chpdd_fm_m1
            APPEND BLANK
            REPLACE NEXT 1 dw WITH lc_dw,;
                        id_chpdd_m WITH lc_id_chpdd_m,;
                        pingm WITH lc_pingm,;
                        dind_bh WITH lc_dind_bh,;
                        bum1_yj WITH lc_bum1_yj,;
                        keh_po WITH lc_keh_po,;
                        liaoh WITH lc_liaoh,;
                        pingm_bh WITH lc_pingm_bh,;        
                        shul_jh WITH IIF(i=lc_i AND lc_mod>0,lc_mod,lc_chpdd_mc5)
    ENDFOR
    SELECT Pr_My_tr_chpdd_fm_m
ENDSCAN  

IF Pr_My_tr_chpdd_fm_b.keh_bh='H239'
    MESSAGEBOX("标签格式不正确!请重新选择“001客户或H239客户标签”!!!","")
    SELECT Pr_My_tr_chpdd_fm_m1
    ZAP
ENDIF

SELECT Pr_My_tr_chpdd_fm_m1
this.InitialSelectedAlias = "Pr_My_tr_chpdd_fm_m1"
2014-03-13 14:03
jyhwcec
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2021-3-8
收藏
得分:0 
你所列图示用VBA制作的
2022-10-05 16:15
快速回复:表单新增、修改、删除操作示例
数据加载中...
 
   



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

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