OldValue not set
To achieve this, I'm using each textbox's OldValue property. It works quite well if you enter data into only one text box. But if you enter in one box, then enter more data in another box, then go back to the first box and remove the data, an Invalid Use of Null error is given--the OldValue is Null even though there was a value in the box. In the code below, when I remove a value from a textbox (which should delete a record in the table), I get an error on the line "Call f_AddRecord..." since OldValue is mysteriously set to Null and, of course, the textbox's current value is Null too since I just removed the value.
Here's the code for one of the text boxes:
Private Sub Ctl25d_AfterUpdate()
If Not IsNull(species_code_FD) Then
If IsNull(Ctl25d.OldValue) Then
Call f_AddRecord(Ctl25d.Value, Ctl25d.Tag)
ElseIf Not IsNull(Ctl25d.OldValue) Then
If Not IsNull(Ctl25d.Value) Then
Call f_UpdateRec(Ctl25d.Value, Ctl25d.Tag)
Else 'Ctl25d is null
Call f_RemoveRecord(Ctl25d.OldValue, Ctl25d.Tag)
End If
End If
End If 'species code null
End Sub
Any help is greatly appreciated!
Doug in Fairbanks

