> THanks for that
> That formula only returns a value from the same line- I need the formula /
[quoted text clipped - 21 lines]
>>>
>>>Can someone tell me the VB coding required to do this function in access
David,
There is no "above" in a table. There is no guarantee that the order will
remain the same.
This is how I would do it.
Make a copy of the table and name it "tblTemp".
Add a new field named "lngOrder" (type number - long)
Now you have a table (tblTemp) with three fields - Field_A, Field_B and lngOrder.
In a Sub, create varA string, varB string, Kount as integer.
(Note: change varA & varB to the proper type.)
Create a recordset, based on tblTemp.
Open the text file and read the first line.
Parse the line (to varA & varB), add a new record, use 1 for the lngOrder field.
Save the value (Field_B?) to a variable - varNewValue.
Kount = 2
Loop thru the text file,
read line from text file
parse line
check if isnull(varA) then use varNewValue
add new record
if isnull(varA) then varNewValue= varB
'Increment counter
Kount = kount+1
Until text file EOF
do cleanup
Then run an Append query to append Field_A and Field_B to the Main table.
It would be easier to answer knowing the field names and having an example of
the data, but this should get you moving in the right direction.
HTH

Signature
Steve
--------------------------------
"Veni, Vidi, Velcro"
(I came, I saw, I stuck around.)