Re: Create Reciprocal Record via After Update - for Dirk Goldgar o



"JohnLute" <JohnLute@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:678B147E-CF1E-4349-A70D-A03BBC8E969B@xxxxxxxxxxxxxxxx

So, what are the data types of the fields
LocationsDestinations and numLocationAddressID?

They're both numeric (Long Integer). I bet Mr. Steele has hit on the
answer...?

Close, but I think he assumed only one of them was numeric. Try this:

If Len(mstrOldDestinations) > 0 Then
.Execute _
"DELETE * FROM tblLocationsDestinations " & _
"WHERE LocationsDestinations=" & Me!numLocationAddressID & _
" AND numLocationAddressID=" & mstrOldDestinations, _
dbFailOnError
End If

' Create a reciprocal record to match the record being saved.
.Execute _
"INSERT INTO tblLocationsDestinations " & _
"(LocationsDestinations, numLocationAddressID) " & _
"VALUES (" & Me!numLocationAddressID & ", " & _
Me.cbLocationsDestinations & ")", _
dbFailOnError


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

.



Relevant Pages