ISO9000Man
Technical User
I have set up some code in the "on click" sub for saving a record on form [frmInspection]. This form has a subform [frmFAInvUpdate] which is linked to the main form control [WorkOrder]. When a record is entered the subform shows all records in tblFAInventory which have the same work order#. The code runs when the record is saved to look at [status] in the subform. If it is "Null" and the inspection passed "Yes", then it changes [status] to "Released' and enters the date in [releasedate]. If the inspection fails "No" it enters "MRB" in [status] field.
The problem I have is when there are multiple records with the same workorder#, and already have "Released" in the [status] field my code does not work on the one which is null. How do I get it to work on the null entry? It works great when there is just one entry for any work order#.
Any help here would be appreciated. I am studying but havn't found out where I am going wrong yet.
--Structure-----------------------------------------------------------
frmInspection: (Main Form)
[WorkOrder]
[Acct_Lot]
frmFAInvUpdatesubform on frmInspection)
[WO] (linked to frmInspection.WorkOrder)
[status]
[releasedate]
tblFAInventory: (data for frmFAInvUpdate)
[Item]
[WO]
[Location]
[Qty]
[arrivedate]
[releasedate]
[status]
---Code Sample------------------------------------------------------------
If Me.Accp_Lot.Value = "Yes" Then
If IsNull(Me.frmFAInvUpdate!status) Then
Me.frmFAInvUpdate!status = "Released"
Me.frmFAInvUpdate!releasedate = Date
End If
End If
If Me.Accp_Lot.Value = "No" Then
If IsNull(Me.frmFAInvUpdate!status) Then
Me.frmFAInvUpdate!status = "MRB"
End If
End If