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
提交
取消