This must be sooo obvious; why can I not find what's going on ?
When I execute the following, I get a key violation error.
If I remove the SalesRecordID update, the update works :
OfferForSale.fkSalesRecordID is a long integer, while SalesRecordID is the primary key of a record newly added to the SalesRecords table. It has been saved by means of Me.Dirty=False and I can check that the new record, with that ID, is indeed in the table before executing this SQL.
Just had a thought - the SalesRecords table is in my front-end while I am testing, whereas the OfferForSale table is on the back-end server. Could that be anything to do with it ?
When I execute the following, I get a key violation error.
Code:
strSQLString = "UPDATE OfferForSale " & _
"SET OfferForSale.SoldFlag = " & True & _
", OfferForSale.fkSalesRecordID = " & SalesRecordID & _
", OfferForSale.HighestBid = " & mSold(mintNumberOfItems).SoldFor & _
" WHERE OfferID = " & lngOfferForSale & ";"
.
.
DoCmd.RunSQL strSQLString
Code:
strSQLString = "UPDATE OfferForSale " & _
"SET OfferForSale.SoldFlag = " & True & _
", OfferForSale.HighestBid = " & mSold(mintNumberOfItems).SoldFor & _
" WHERE OfferID = " & lngOfferForSale & ";"
.
.
DoCmd.RunSQL strSQLString
Just had a thought - the SalesRecords table is in my front-end while I am testing, whereas the OfferForSale table is on the back-end server. Could that be anything to do with it ?