Hi,
I have a form which contains a subform. Both are were creetd using the form wizard and are bound by the column IXO_NR (on two different tables), which is the control source for a textbox on both the parent and subform.
The intent was to default the subform's IXO_NR to the parent form's IXO_NR, then requery the subform to prevent the user from having to scroll through all of the subform's records to find the one they may be looking for. In the case of a new record on the parent form, IXO_NR on the subform should be reset since it contains the value from the last record selected.
I tried to reset it a number of ways and I kept getting an ODBC error as, I'm assuming, since a value was populated in the subform's textbox, Access interpreted that a new record was being added in the subform as well. Since the subform has a couple of not null columns, an ODBC error was generated.
On the parent form's FORM_CURRENT event:
If Me!txtInfoXchgO bjNr > 0 Then
Me!subfrmIXODes c!txtInfoXchgOb jNr.DefaultValu e = Me!txtInfoXchgO bjNr
Me!subfrmIXODes c.Requery
Else
' Me!subfrmIXODes c!txtInfoXchgOb jNr.Undo
' Me!subfrmIXODes c!txtInfoXchgOb jNr.Value = 0
' etc.
End If
So how can I reset the subform / subform's textbox to prevent this ?
Thanks, Ed.