|
本帖最后由 yanwei82123300 于 2023-4-1 14:11 编辑
请老师给看看附件中的例子,提示:名称与存在的模块工程或对象冲突
修改了引用还是不行,不知什么原因?
同时这个例子请帮助修改一下代码使用ADO,来设计,感谢
Dim rs As ADODB.记录集
rs = New ADODB。Recordset
代码如下
Private Sub GetPONo_Click()
Dim Criteria As String, mydb As Database, myset As Recordset
Dim Value As Long, Counterstr As String
If IsNull(Me.PO_No) Or Me.PO_No <= " " Then
Criteria = "ID = 1"
Set mydb = DBEngine.Workspaces(0).Databases(0)
Set myset = mydb.OpenRecordset("POCounter_Remote", dbOpenDynaset)
myset.FindFirst Criteria
If Not myset.NoMatch Then
Me.PO_No = myset![Last_Counter]
Value = Val(myset![Last_Counter]) + 1
Counterstr = Right$(Trim$("00000000" + Trim$(Str(Value))), 8)
myset.Edit
myset![Last_Counter] = Counterstr
myset.Update
Me.PO_Date = Date
Else
MsgBox "Your PO Counter Table was empty, please contact IMM"
End If
myset.Close
Else
MsgBox "Sorry You must clear PO No before Continue"
Exit Sub
End If
End Sub
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|