但我确信这些数据类型可以一起使用,1 个表中的 ItemID 是 AutoNumber,另一个表中是一个数字。
Private Sub Command17_Click()
Dim cmbItem As String
cmbItem = "SELECT ItemID FROM Items WHERE Items.Name = " & Me.Combo0.Value & ";"
Dim sc1 As DAO.Recordset
Set sc1 = CurrentDb.OpenRecordset("Buy", dbOpenDynaset)
sc1.AddNew
sc1.Fields("ItemID").Value = cmbItem
sc1.Fields("BuyPrice").Value = Me.Text13.Value
sc1.Fields("Notes").Value = Me.Text18.Value
sc1.Update
End Sub
在此先感谢,鲍勃 P