justice8965
Registered User.
- Local time
- Today, 02:10
- Joined
- Aug 25, 2009
- Messages
- 32
Hey guys, have a question. I'm using Access 97.
So I have a linked query I made in query designer. What I'm trying to do is call a VBA function I have in a module from the query designer. What this function needs to do is check if we are currently on the first row of the query (or the earliest BeginDate field in the query, either works). If we are, it does a simple calculation. If not, I need to grab a field from the row prior to the one we're on and do the calculation. For example
if firstrow
use = (firsthalf + secondhalf) * average
else
use = (firsthalf * previousaverage) + (secondhalf * average)
end if
How would I go about doing either of these things? I can't use rs.index since its a linked table, and I've tried some other things that didn't work.
So I have a linked query I made in query designer. What I'm trying to do is call a VBA function I have in a module from the query designer. What this function needs to do is check if we are currently on the first row of the query (or the earliest BeginDate field in the query, either works). If we are, it does a simple calculation. If not, I need to grab a field from the row prior to the one we're on and do the calculation. For example
if firstrow
use = (firsthalf + secondhalf) * average
else
use = (firsthalf * previousaverage) + (secondhalf * average)
end if
How would I go about doing either of these things? I can't use rs.index since its a linked table, and I've tried some other things that didn't work.