Aerowolf
Programmer
- Nov 6, 2002
- 64
The code I have is below. The Shipment form has the field [LOC] which is one of a few set values (ie. RAW, SV, NB, or FB).These values represent the names of fields in the Parts table. Once the form is updated I want to use the value of [LOC] to reference that field in the Parts table. How do I do this?
Private Sub LOC_Enter()
If Left([PARTID], 8) = "WM-1601-" Or Left([PARTID], 8) = "WM-1540-" Then
If [PARTID] <> "WM-1601-NC" Then
[LOC] = "SV"
End If
Else
[LOC] = "RAW"
End If
End Sub
Private Sub Form_AfterUpdate()
DoCmd.OpenForm "frmParts", , , , acFormEdit
DoCmd.FindRecord [Forms]![frmShipment]![PARTID]
[Forms]![frmParts]![ value from LOC ] = [Forms]![frmParts]![ value from LOC ] - [Forms]![frmShipment]![QTY]
.
.
.
End Sub
Private Sub LOC_Enter()
If Left([PARTID], 8) = "WM-1601-" Or Left([PARTID], 8) = "WM-1540-" Then
If [PARTID] <> "WM-1601-NC" Then
[LOC] = "SV"
End If
Else
[LOC] = "RAW"
End If
End Sub
Private Sub Form_AfterUpdate()
DoCmd.OpenForm "frmParts", , , , acFormEdit
DoCmd.FindRecord [Forms]![frmShipment]![PARTID]
[Forms]![frmParts]![ value from LOC ] = [Forms]![frmParts]![ value from LOC ] - [Forms]![frmShipment]![QTY]
.
.
.
End Sub