|
注釋:
參數R:http://www.woyoushebao.com/content/090424/14/19147_3251622.html b=alltrim(thisform.Text2.value)
c=alltrim(thisform.Text3.value) if empty(b) &&此條件成立則說明該文本框是空的 messagebox("請輸入網站名稱",16,"系統(tǒng)提示") return else locate for 網站名稱=b if .not.eof() &&此條件成立,說明要添加的內容和表中有重復的 go top messagebox("不允許有重復的網站名稱",16,"系統(tǒng)提示") return endif endif msg=messagebox('確定要添加記錄嗎?',32+4,'系統(tǒng)提示')
if msg=6 && 6為是、7否 &&以下將文本框內的值插入記錄
INSERT INTO "contacts.types" ("subject_type_id","subject_type") ;
VALUES("alltrim(thisform.Text1.value)","alltrim(thisform.Text2.value)") messagebox('保存記錄成功!',64,'系統(tǒng)提示') thisform.grid1.refresh
calculate max(subject_type_id) to maxbh &&在數據表中查找出序號最大的記錄 szbh=val(right(maxbh,3)) &&取出數字部分 if szbh=0 then &&判斷數字部分是否為0 zdbh='KM001' else zdbh='wz'+padl(alltrim(str(szbh+1)),3,'0') &&生成自動編號 endif thisform.Text1.value=zdbh thisform.Text2.value="" thisform.Text2.setfocus thisform.refresh endif |
|
|