亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

這個是我的代碼,但是在運行的時候說缺少函數或者變量,我是想要添加一個東西到數據庫的表里面?

這個是我的代碼,但是在運行的時候說缺少函數或者變量,我是想要添加一個東西到數據庫的表里面?

烙印99 2022-08-11 11:07:51
Private Sub Command1_Click()If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text6.Text = "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or Text10.Text = "" Or Text11.Text = "" Or Text12.Text = "" Or Text13.Text = "" Or Text14.Text = "" Or Text15.Text = "" Or Text16.Text = "" ThenMsgBox "填寫的信息不完整", vbOKOnly + vbExclamation, ""Text1.SetFocusExit SubEnd IfWith DatalRecordset.AddNewRecordset.Fields("款號") = Text1.TextRecordset.Fields("品號") = Text2.TextRecordset.Fields("顏色") = Text3.TextRecordset.Fields("色號") = Text4.TextRecordset.Fields("S") = Text5.TextRecordset.Fields("M") = Text6.TextRecordset.Fields("L") = Text7.TextRecordset.Fields("XL") = Text8.TextRecordset.Fields("XXL") = Text9.TextRecordset.Fields("XXL") = Text11.TextRecordset.Fields("庫存數") = Text12.TextRecordset.Fields("價格") = Text13.TextRecordset.Fields("分類") = Text14.TextRecordset.Fields("面料") = Text15.TextRecordset.Fields("季節") = Text16.TextRecordset.Fields("年份") = Text10.TextDatal RefreshText1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text6.Text = "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or Text10.Text = "" Or Text11.Text = "" Or Text12.Text = "" Or Text13.Text = "" Or Text14.Text = "" Or Text15.Text = "" Or Text16.Text = ""Text1.SetFocusEnd SubPrivate Sub Command2_Click()Form2.ShowEnd Sub
查看完整描述

2 回答

?
回首憶惘然

TA貢獻1847條經驗 獲得超11個贊

Recordset 是Datal 的一個屬性,所以你的 with 塊里應該這么寫:
.Recordset.AddNew
.Recordset.Fields("款號") = Text1.Text
另外,with 塊需要 End With 來結尾

查看完整回答
反對 回復 2022-08-15
?
吃雞游戲

TA貢獻1829條經驗 獲得超7個贊

Private Sub GCD(ByRef m As Long, ByRef n As Long)問題出在這里!你調用n1 = GCD(m1, n1)
需要有返回值,sub是沒有返回值的,應該是Private function GCD(ByRef m As Long, ByRef n As Long),另外在GSD里要用GCD=返回值才可以!

查看完整回答
反對 回復 2022-08-15
  • 2 回答
  • 0 關注
  • 205 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號