Hello all,
I am relatively new to MS Access and have been teaching myself how to develop a database for inventory/'samples received' application. Just a little background - I'm a biologist. We give samples a unique identification number when we collect them. The form I have developed is used to scan in these new samples (though barcode) when they are brought back to the lab. The database tracks 'new' barcodes scanned and provides a detailed report on the number of each species that have been added to the inventory...it also allows us to track what samples we have on-hand.
I am having trouble getting the subform (SamplesReceivedSubForm) to clear 'older' scanning events when a new event is initiated. Currently, both the subform (SamplesReceivedSubForm) are blank when main form (ScanEntryForm) is first opened; however, the subform autopopulates 'old' information as soon as the user makes any changes in the mainform (see images - first one is the form when it is just opened; second is after a selection has been made in the main form which results in autopopulated 'old' data in the subform).
Attachment 19294 Attachment 19295
I've searched for possible solutions but most seem to be wanting a button to clear -- which I do not. I want it to automatically clear all the data on the forms (on close, on load, or however...) and provide a fresh entry form whenever the user reopens the form.
Currently, I have the parent form event clearing old data "on load" with the following code:
Private Sub Form_Load()
'clear previous records on load
DoCmd.GoToRecord , , acNewRec
End Sub
I also have the main form and subform 'linked' via ScanPK (parent) and ScanFK (child)
Attachment 19296
Any suggestions? Thanks ahead of time!! I'm running Access 2007