Hi
I have the following code attached to a command button.
When I run it the code errors out to a "Type Mismatch" error box generated by Access.
I've checked the properties and methods but the highlighted line is the one starting "Set rstSpPrice..."
Private Sub cmdWriteSpPrice_Click()
Dim dbs As Database, rstSpPrice As Recordset
Set dbs = CurrentDb
Set rstSpPrice = dbs.OpenRecordset("tblSpecialPrice", dbOpenTable)
rstSpPrice.AddNew
rstSpPrice!ORDER_NUMBER = txtSpPriceOrderNo.Value
rstSpPrice!ITEM_NUMBER = txtSpPriceItemNo.Value
rstSpPrice!STOCK_CODE = txtSpPriceStockCode.Value
rstSpPrice!DESCRIPTION = txtSpPriceDesc.Value
rstSpPrice!SpPrice = txtSpecialPrice.Value
rstSpPrice.Update
rstSpPrice.CancelUpdate
End Sub
Any help would be appreciated. Thankyou.
I'm using Access 2000
Andy
I have the following code attached to a command button.
When I run it the code errors out to a "Type Mismatch" error box generated by Access.
I've checked the properties and methods but the highlighted line is the one starting "Set rstSpPrice..."
Private Sub cmdWriteSpPrice_Click()
Dim dbs As Database, rstSpPrice As Recordset
Set dbs = CurrentDb
Set rstSpPrice = dbs.OpenRecordset("tblSpecialPrice", dbOpenTable)
rstSpPrice.AddNew
rstSpPrice!ORDER_NUMBER = txtSpPriceOrderNo.Value
rstSpPrice!ITEM_NUMBER = txtSpPriceItemNo.Value
rstSpPrice!STOCK_CODE = txtSpPriceStockCode.Value
rstSpPrice!DESCRIPTION = txtSpPriceDesc.Value
rstSpPrice!SpPrice = txtSpecialPrice.Value
rstSpPrice.Update
rstSpPrice.CancelUpdate
End Sub
Any help would be appreciated. Thankyou.
I'm using Access 2000
Andy