I have a class Human. A form lists all humans. When the user double
clicks on a human, I open another form showing the details of that
human.
There is a global variable on the detail form called CurrentHuman of
type human. When the user double clicks a human in the list on the
first form, I do a search to find the object and set the global
variable 'CurrentHuman' = to this object.
Now when I am in the detail form I have a button that deletes the
object 'CurrentHuman' but it is not working. Here is some of my code:
This finds the object that the user double cliked on by searching for
the unique ID property (EntityID is the ID value of the human that was
double clicked). The object found here is sent to the 'CurrentHuman'
global variable on the detail form
Dim results As ObjectSet = db.Get(GetType(Human))
For Each h As Human In results
If h.ID = EntityID Then
Return h
Exit Function
End If
Next
Here is what I have to delete the human object
db.Delete(CurrentHuman)
This is not working however, what could be going wrong?
>> Stay informed about: DB4o - Can't delete object stored in global variable