I'm trying to convert some Visual FoxPro applications to Access/VBA, and I find that I'm spoiled to some of the old xbase code. For example, VFP has a recno() function. I realize that Access does not have this for practical reasons, but unfortunately, I still need it.
My data sitch is this: I'm an engineer for a state DOT and deal with large amounts of pavement data. We number our overlay jobs in ascending data order. In their infinite wisdom, the original database designers (in a custom-built Sybase platform) would not let us have the overlay number, saying that we can order it by date. But people like and want the overlay number on reports.
I queried and ordered the pvmt_rehab table in desending order by date, but I can't get the overlay/rehab # in there. If I use the RunningSum method, but it will only number them top-down, and I want them numbered bottom-up. This is to match how the pavement structure is built--first overlay on bottom, second overlay next, third overlay on top, etc.
In VFP I could SCAN. . . ENDSCAN through the table, pull the overlays out for each pavement section into a cursor, order them by date, assign the recno() as the overlay number, then insert the overlay number into the main table. Crude but effective.
How can I do this in VBA/Access? I've searched but haven't come up with anything. Any other VFP folks out there that made the transition from the easy xbase code to VBA? I don't write a lot of full-blown applications, but mainly crunch complex data and do some somewhat complex reporting. VFP is wonderful for the data analysis but not so much for the reporting, so I was hoping Access would do the job.
Any help is appreciated.
My data sitch is this: I'm an engineer for a state DOT and deal with large amounts of pavement data. We number our overlay jobs in ascending data order. In their infinite wisdom, the original database designers (in a custom-built Sybase platform) would not let us have the overlay number, saying that we can order it by date. But people like and want the overlay number on reports.
I queried and ordered the pvmt_rehab table in desending order by date, but I can't get the overlay/rehab # in there. If I use the RunningSum method, but it will only number them top-down, and I want them numbered bottom-up. This is to match how the pavement structure is built--first overlay on bottom, second overlay next, third overlay on top, etc.
In VFP I could SCAN. . . ENDSCAN through the table, pull the overlays out for each pavement section into a cursor, order them by date, assign the recno() as the overlay number, then insert the overlay number into the main table. Crude but effective.
How can I do this in VBA/Access? I've searched but haven't come up with anything. Any other VFP folks out there that made the transition from the easy xbase code to VBA? I don't write a lot of full-blown applications, but mainly crunch complex data and do some somewhat complex reporting. VFP is wonderful for the data analysis but not so much for the reporting, so I was hoping Access would do the job.
Any help is appreciated.
Last edited: