在access中创建vb窗体,使文本框中内容填写到access表中解决办法
在access中创建vb窗体,使文本框中内容填写到access表中
现在在窗体下编译到rst.open sql就出错,一直没弄明白错在哪,请各位大侠指教,谢谢
Private Sub 确定_Click()
Dim sql As String
Dim rst As ADODB.Recordset
Dim number As Integer
sql = "select * from 商品信息 where"
sql = sql & " [货号]=" & Me![货号列表]
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
rst.Open sql
…………………
VisualBasic程序开发环境 程序开发 VisualBasic
Answers
1. [货号]可能是字符型字段
2. Me![货号列表] 的值为 空
Private Sub 确定_Click()
Dim sql As String
Dim rst As ADODB.Recordset
Dim number As Integer
sql = "select * from 商品信息 where"
sql = sql & " [货号]=" & Me![货号列表]
msgbox sql
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
rst.Open sql
…………………