Need help with coding logic

  • Thread starter robert d via AccessMonster.com
  • Start date
R

robert d via AccessMonster.com

My application uses weather data for different stations around the country to
perform various calculations. I have a form where the weather data is used
to perform these calculations. The issue I have is the year for the weather
data.

For example, let's say it's May of 2006 and the user wants to perform the
calculation for the LAX weather station. The calculation needs a full year's
worth of data, so data for 2005 should be used. However, it's also possible,
that for some reason some or all of the weather data for 2005 is missing, so
the calculation needs to go back to 2004. Because these calculations are
setup for comparisons by fiscal year, it's not possible to use the previous
12 months worth of data (i.e. May 2005 through April 2006), but instead we
have to use the previous fiscal year (let's assume for now its the calendar
year, but administrators can set whatever they want).

I'm struggling with whether I should populate a combobox entitled FY with
fiscal years for which there are a full 12 months of data, or should I wait
until the user tries to run a calculation and then inform them that there is
no or insufficient weather data for the year they've selected.

What complicates this whole thing is that the table with the weather data
also has three other fields which essentially form the primary key. So a
yearr's worth of this data is not 12 rows (one for each month) but more like
3168 rows per weather station. And because I don't know what the user has
selected for the three other fields when the form first opens, I can't be 100%
sure that the full 3168 rows for any given fiscal year are there. Also, I
don't want to hard code look for 3168 rows, because that number may change in
the table in the future.

One thing is for sure, when the user sets all of the parameters including the
fiscal year, then only 12 rows out of the 3168 rows are retrieved for the
calculation.

So it would seem to make sense to wait until everything is set and the user
clicks on the Calculate button and then determine if the required data is
there. If data is missing, then it could be annoying in that they will have
to keep selecting a new fiscal year until they find one with a full twelve
rows for the FY, weather station and other options that were set. But on the
other hand, they are supposed to keep the data up-to-date, and this could
help in getting them to do that.

I would appreciate advice on how experienced developers would handle this.

Thanks.
 
J

John Nurick

Hi Robert,

At first sight, the best approach might be to have a the user set the
other parameters first, and then update the combobox to show which years
have the required data. You could do this either from the AfterUpdate
event of each of the controls that set the parameters (thus keeping the
list of years permanently up to date), or (in a wizard interface) after
they select the last parameter, or simply from a button "Show available
years".

combo box showing the available financial years, and update this
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top