Happy Friday All!
My issue: I have a DLookup-After Update event on a continuous subform that will not allow me to edit the values and continue to the next row. I can edit the record persay but when attempting to move on to the next row in the subform to pull another record, it tries to save the current record as a new record to the table (duplicating the value) rather than simply updating the existing information. It then generates an error about duplicate values.
What the form does: The main form act as a manifest. Each row of my subform has a property item, to which belong to separate individuals. The manifest has a date indicating what date the items were sent out along with other individuals property. For example
Main Form Data:
Date: 1/4/13
Sent By : Steve
Subform Data:
BagNum: 77878, DateIn 1/2/13, PropertyTypeID 1, DetentionID 28999, PropertyID 33
BagNum: 77879, DateIn 1/1/13, PropertyTypeID 2, DetentionID 32998, PropertyID 34
BagNum: 77881, DateIn 12/1/12, PropertyTypeID 1, DetentionID 31959, PropertyID 35
BagNum: 77876, DateIn 1/1/13, PropertyTypeID 1, DetentionID 38919, PropertyID 39
*bold indicates text boxes
I have a main form [frmPropertyTransfer] with record source from a table [tblPropertyManifest] with a continuous subform [SubfrmPropertyTransfer] with a record source from a select query [qryPropertyTransfer]. The main form is a manifest for items being shipped out where the Parent to Child relationship is:
frmPropertyTransfer – PropertyManifestID
SubfrmProeprtyTransfer – PropertyManifest_fk
On my subform, I have an After Update event:
I haven’t had luck with a previous post last month and attempting to explain the situation again.
Thank you in advance!
My issue: I have a DLookup-After Update event on a continuous subform that will not allow me to edit the values and continue to the next row. I can edit the record persay but when attempting to move on to the next row in the subform to pull another record, it tries to save the current record as a new record to the table (duplicating the value) rather than simply updating the existing information. It then generates an error about duplicate values.
What the form does: The main form act as a manifest. Each row of my subform has a property item, to which belong to separate individuals. The manifest has a date indicating what date the items were sent out along with other individuals property. For example
Main Form Data:
Date: 1/4/13
Sent By : Steve
Subform Data:
BagNum: 77878, DateIn 1/2/13, PropertyTypeID 1, DetentionID 28999, PropertyID 33
BagNum: 77879, DateIn 1/1/13, PropertyTypeID 2, DetentionID 32998, PropertyID 34
BagNum: 77881, DateIn 12/1/12, PropertyTypeID 1, DetentionID 31959, PropertyID 35
BagNum: 77876, DateIn 1/1/13, PropertyTypeID 1, DetentionID 38919, PropertyID 39
*bold indicates text boxes
I have a main form [frmPropertyTransfer] with record source from a table [tblPropertyManifest] with a continuous subform [SubfrmPropertyTransfer] with a record source from a select query [qryPropertyTransfer]. The main form is a manifest for items being shipped out where the Parent to Child relationship is:
frmPropertyTransfer – PropertyManifestID
SubfrmProeprtyTransfer – PropertyManifest_fk
On my subform, I have an After Update event:
Code:
[SIZE=3][FONT=Arial]Private Sub BagNum_AfterUpdate()[/FONT][/SIZE]
[SIZE=3][FONT=Arial]'Control Source = Nz(DLookup("Control Source", "my table", "[Control Source after update value] = _[/FONT][/SIZE]
[SIZE=3][FONT=Arial]''" & [Control Source after upate value] & "'"))[/FONT][/SIZE]
[SIZE=3][FONT=Arial]Me.DateIn = Nz(DLookup("DateIn", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))[/FONT][/SIZE]
[SIZE=3][FONT=Arial]Me.PropertyTypeID = Nz(DLookup("PropertyTypeID", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))[/FONT][/SIZE]
[SIZE=3][FONT=Arial]Me.DetentionID = Nz(DLookup("DetentionID", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))[/FONT][/SIZE]
[SIZE=3][FONT=Arial]Me.PropertyID = Nz(DLookup("PropertyID", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))[/FONT][/SIZE]
[SIZE=3][FONT=Arial]End Sub[/FONT][/SIZE]
Thank you in advance!