Static lastTid as variant Dim newVal as Short If (lastTid = [MMSI_Date]) Then newVal = 1 Else newVal = 0 End If lastTid = [MMSI_Date]
lastTid
Solved! Go to Solution.
I am having trouble trying to figure out how to use the calculate field function to calculate a field based on the next record. I have a lines database that are organized based on a particular ID field (MMSI_Date, a text field). For example, 1000 lines have MMSI_Date ABC, 1100 lines have MMSI_Date DEF, etc. The problem is that the last record in each MMSI_Date group should be associated with the next group. Its a problem with the tool I used to generate this data. So this is what I have tried to do:
Pre-LogicStatic lastTid as variant Dim newVal as Short If (lastTid = [MMSI_Date]) Then newVal = 1 Else newVal = 0 End If lastTid = [MMSI_Date]
ExpressionlastTid
Needless to say, this isn't working. In fact, I am getting a general 999999 Error. Note: I have some beginner-level experience with VB in field calculations, but have never done anything at this level.
Any help or insight are appreciated.
Thanks!