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 來結尾

吃雞游戲
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=返回值才可以!
添加回答
舉報
0/150
提交
取消