蓝老师,我想借助狐友分享的销售开piao系统,改成新建账套的功能,这一步实现了,但用自定义登录窗口登录时总提示错误:
.NET Framework 版本:4.0.30319.36543
Foxtable 版本:2022.7.3.1
错误所在事件:
详细错误信息:
This row has been removed from a table and
does not have any data. BeginEdit() will
allow creation of new data in this row.
自定义登录窗口的“确定”按钮代码是:
Dim tx1 As
WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim user As String = tx1.text
Dim sss As String = e.Form.Controls("ComboBox2").text 'sss项目文件名
Dim tx2 As
WinForm.TextBox = e.Form.Controls("TextBox2")
Dim pows As String = tx2.text
Dim dl As WinForm.Button = e.Form.Controls("Button1")
Dim dt As DataTable = DataTables("用户表")
Dim dr As DataRow
If user = ""
Then
MessageBox.show("请输入用户名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return
Else
dr = dt.find("用户名称='" & user & "'")
If dr IsNot Nothing Then
If pows =
dr("密码") Then
PopMessage("登陆成功", "提示", PopIconEnum.Infomation, 1)
dr("登陆时间") = Date.Now
dr("登陆账套") = sss 'sss项目文件名
dr.Save()
usna = user
syscmd.project.open(ProjectFile,
sss)'打开项目,ProjectFile返回已经打开的项目文件名
e.Form.close
'syscmd.project.Exit(True)
Return
Else
MessageBox.show("密码错误", "提示")
Return
End If
Else
MessageBox.show("用户不存在!", "提示")
Return