Access 2010 here.
I have a nagging concern with two of my three subforms. The subforms are each bound to their own table with unique information; the main form is also bound to its own table. All three subform tables are in a one-to-one relationship with the main form table. My first subform acts normally in that when there is a new record, all of its bound entry fields are displayed blank. The code in Form_Current():
Private Sub Form_Current()
'Determine what should be displayed'
'Do stuff to prepare the current record for display'
If Me.NewRecord = True Then
Me.Stuff = Null
End If
End Sub
is present for all three subforms and the main form to display older records and to ready the form for data entry by resetting check boxes etc; there is no code to "reset" the entry fields themselves. Unfortunately, the other two subforms retain data from the last entered record and display it as if the user wants to re-enter the same data. The thing is, this data means nothing unless the user explicity enters the data entry field and then leaves it by any means. Simply moving on to the next record without entering the data entry fields doesn't save the phantom pre-entered data (which is expected as the record in the subform was never made as the user never entered data in the subform).
What I am looking for is either a form-specific option to open a clean record by default, or VBA code that can ensure empty data fields on new record. I have tried actively re-querying the subforms when a new record is opened in the main form without success. I have also tried pre-setting values to "" upon entering a new record, which did work to an extent, but seeing as one subform works properly, I am after a solution, not a workaround.