编写程序如下:
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