mdschuetz
Nerd Incognito
- Local time
- Today, 00:44
- Joined
- Oct 31, 2007
- Messages
- 49
The next part of this project is pretty technical.
I have a question…
Purchase Orders Subform
Each row above is a Recordset?
The goal is to get the DUE field to update as items are received.
For instance, the first row and the last row, they each are for part number 2252 but have different Dates and Invoice numbers. However, they are from the same job (Job# 222), so I want the updated amount due to populate in the most recent recordset.
I think the way to start is to define the variables which will be used in the If statement to accomplish this.
Dim vJob As Integer
Dim vPart As String
Dim vRec As Integer
Dim vDue As Integer
Dim vDate As Date
Dim vOrdered as Integer
vOrdered = Me.txtUnitsOrdered
vJob = Me.txtJob
vPart = Me.txtPart
vRec = Me.txtUnitsReceived
vDue = Me.txtUD
vDate = Me.txtDate
Now comes the logic,
But before I can start to put it together, I need to know how to uniquely identify each recordset. If I knew how to do this, I could code an If statement to update the Due field in the most recent recordset based on Recordset(1)vDate < Recordset(2)vDate.
Something like….
If Recordset(1) vJob And vPart = Recordset(2) vJob And vPart Then
Recordset(2) vDue = Recordset(1) vOrdered – Recordset(1) vRec + Recordset(2) vRec
End If
Does that make any sense?
I know its probally not even close on how to do it, but then again, I don’t know how to work with individual recordsets.
Can someone please show me how?
I have a question…
Purchase Orders Subform
PHP:
Date Job Part Description Price PO GPC Requested Received Due Rejected Invoice Number
11/9/2007 222 2252 bolts $2.25 27 CAM 5 3 2 0 MOSL223224
11/9/2007 222 2452 nuts $1.85 27 CAM 10 4 6 0 MOSL223224
11/9/2007 222 2241 washers $0.96 27 CAM 20 12 8 0 MOSL223224
11/9/2007 222 2216 springs $0.52 27 CAM 50 20 30 0 MOSL223224
11/9/2007 222 2171 sprockets $1.95 27 CAM 79 59 20 0 MOSL223224
11/14/2007 222 2252 bolts $2.25 27 CAM 5 1 4 0 MOSL223555
Each row above is a Recordset?
The goal is to get the DUE field to update as items are received.
For instance, the first row and the last row, they each are for part number 2252 but have different Dates and Invoice numbers. However, they are from the same job (Job# 222), so I want the updated amount due to populate in the most recent recordset.
I think the way to start is to define the variables which will be used in the If statement to accomplish this.
Dim vJob As Integer
Dim vPart As String
Dim vRec As Integer
Dim vDue As Integer
Dim vDate As Date
Dim vOrdered as Integer
vOrdered = Me.txtUnitsOrdered
vJob = Me.txtJob
vPart = Me.txtPart
vRec = Me.txtUnitsReceived
vDue = Me.txtUD
vDate = Me.txtDate
Now comes the logic,
But before I can start to put it together, I need to know how to uniquely identify each recordset. If I knew how to do this, I could code an If statement to update the Due field in the most recent recordset based on Recordset(1)vDate < Recordset(2)vDate.
Something like….
If Recordset(1) vJob And vPart = Recordset(2) vJob And vPart Then
Recordset(2) vDue = Recordset(1) vOrdered – Recordset(1) vRec + Recordset(2) vRec
End If
Does that make any sense?
I know its probally not even close on how to do it, but then again, I don’t know how to work with individual recordsets.
Can someone please show me how?