VFP如何用表单向表里添加数据,代码是什么。详细点的!谢谢! 界面如下
展开全部
在表单中点右键,选“数据环境...”选择你要的表。
然后在“添加”按钮中输入以下代码:
SELECT 情况表
IF ALLTRIM(THISFORM.text1.VALUE)=''
=MESSAGEBOX('请输入姓名等资料',48,'信息提示')
RETURN
ENDIF
IF MESSAGEBOX('请仔细核对,以保证录入资料的完整、准确! '+CHR(13)+CHR(13)+'上述资料正确无误吗?',48+4,'信息提示')=6
APPEND BLANK
REPLACE 姓名 WITH THISFORM.text1.VALUE,性别 WITH THISFORM.text2.VALUE
REPLACE 家庭地址 WITH THISFORM.text3.VALUE,出生年月 WITH THISFORM.text4.VALUE
REPLACE 手机 WITH THISFORM.text5.VALUE,QQ WITH THISFORM.text6.VALUE
REPLACE 邮政编码 WITH THISFORM.text7.VALUE,E_mail WITH THISFORM.text8.VALUE
REPLACE 生肖 WITH THISFORM.text9.VALUE,民族 WITH THISFORM.text10.VALUE
REPLACE 备注 WITH THISFORM.text11.VALUE
STORE '' TO THISFORM.text1.VALUE,THISFORM.text2.VALUE,THISFORM.text3.VALUE
STORE '' TO THISFORM.text4.VALUE,THISFORM.text5.VALUE,THISFORM.text6.VALUE
STORE '' TO THISFORM.text7.VALUE,THISFORM.text8.VALUE,THISFORM.text9.VALUE
STORE '' TO THISFORM.text10.VALUE,THISFORM.text11.VALUE
ENDIF
然后在“添加”按钮中输入以下代码:
SELECT 情况表
IF ALLTRIM(THISFORM.text1.VALUE)=''
=MESSAGEBOX('请输入姓名等资料',48,'信息提示')
RETURN
ENDIF
IF MESSAGEBOX('请仔细核对,以保证录入资料的完整、准确! '+CHR(13)+CHR(13)+'上述资料正确无误吗?',48+4,'信息提示')=6
APPEND BLANK
REPLACE 姓名 WITH THISFORM.text1.VALUE,性别 WITH THISFORM.text2.VALUE
REPLACE 家庭地址 WITH THISFORM.text3.VALUE,出生年月 WITH THISFORM.text4.VALUE
REPLACE 手机 WITH THISFORM.text5.VALUE,QQ WITH THISFORM.text6.VALUE
REPLACE 邮政编码 WITH THISFORM.text7.VALUE,E_mail WITH THISFORM.text8.VALUE
REPLACE 生肖 WITH THISFORM.text9.VALUE,民族 WITH THISFORM.text10.VALUE
REPLACE 备注 WITH THISFORM.text11.VALUE
STORE '' TO THISFORM.text1.VALUE,THISFORM.text2.VALUE,THISFORM.text3.VALUE
STORE '' TO THISFORM.text4.VALUE,THISFORM.text5.VALUE,THISFORM.text6.VALUE
STORE '' TO THISFORM.text7.VALUE,THISFORM.text8.VALUE,THISFORM.text9.VALUE
STORE '' TO THISFORM.text10.VALUE,THISFORM.text11.VALUE
ENDIF
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询