I am doing something similar to a library system, except it is property. For this you scan the bar code which returns a number.
I am running into an error on my last item PropertyID = Nz.....
It produces a run-time error, you can't assign a value to this object.
I am confused because the DetentionID passed with no issue but PropertyID doesn't, it simply assigns a new ID.
Any suggestions on why or improving this code?
I am running into an error on my last item PropertyID = Nz.....
It produces a run-time error, you can't assign a value to this object.
I am confused because the DetentionID passed with no issue but PropertyID doesn't, it simply assigns a new ID.
Code:
[SIZE=3][FONT=Arial]Option Compare Database[/FONT][/SIZE]
[SIZE=3][FONT=Arial]Private Sub Bag__AfterUpdate()[/FONT][/SIZE]
[SIZE=3][FONT=Arial]DateIn = Nz(DLookup("DateIn", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))[/FONT][/SIZE]
[SIZE=3][FONT=Arial]PropertyTypeID = Nz(DLookup("PropertyTypeID", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))[/FONT][/SIZE]
[SIZE=3][FONT=Arial]Notes = Nz(DLookup("Notes", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))[/FONT][/SIZE]
[SIZE=3][FONT=Arial]TransferFrom = Nz(DLookup("TransferFrom", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))[/FONT][/SIZE]
[SIZE=3][FONT=Arial]PropertyDestroyed = Nz(DLookup("PropertyDestroyed", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))[/FONT][/SIZE]
[SIZE=3][FONT=Arial]DetentionID = Nz(DLookup("DetentionID", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))[/FONT][/SIZE]
[SIZE=3][FONT=Arial][COLOR=royalblue]PropertyID = Nz(DLookup("PropertyID", "tblPropertyDetails", "[BagNum] = '" & [BagNum] & "'"))[/COLOR][/FONT][/SIZE]
[SIZE=3][FONT=Arial]End Sub[/FONT][/SIZE]
Any suggestions on why or improving this code?