I am running into an issue when I run an AfterUpdate event on my subform, which is a continuous form (ugh - i know, but couldn't think of an alternative way to do what i wanted). After the event and moving to the next row, it duplicates the table values. Is there a way to prevent this?
What I am attempting to do is scan a bag, then scan another, and another, and..... I need to update certain aspects to the bag as to where it is going.
In the end, I'd like to print a report with all the scanned bags.
I have attached my sample database with a few pictures of what is happening.
What I am attempting to do is scan a bag, then scan another, and another, and..... I need to update certain aspects to the bag as to where it is going.
In the end, I'd like to print a report with all the scanned bags.
Code:
Option Compare Database
Option Explicit
Private Sub BagNum_AfterUpdate()
'Control Source = Nz(DLookup("Control Source", "my table", "[Control Source after update value] = _
''" & [Control Source after upate value] & "'"))
Me.DateIn = Nz(DLookup("DateIn", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))
Me.PropertyTypeID = Nz(DLookup("PropertyTypeID", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))
Me.Notes = Nz(DLookup("Notes", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))
Me.PropertyDestroyed = Nz(DLookup("PropertyDestroyed", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))
Me.DetentionID = Nz(DLookup("DetentionID", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))
Me.PropertyID = Nz(DLookup("PropertyID", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))
I have attached my sample database with a few pictures of what is happening.
Attachments
Last edited: