Assign autonumber before update

  • Thread starter Thread starter kRISSE
  • Start date Start date
K

kRISSE

I need the autonumber before I update a new record to
execute an afterupdate procedure to do a calculation that
gets placed into one of the record fields. I need to do
this because there are other tables that have some of the
pieces of the calculation.

In the macro that runs the query that calculates the value
I need, I am referencing the autonumber field as the
criteria.

If this is not possible, how else can I get the results I
need?

Hope this is enough information. Let me know if you need
more info.

Thanks!
 
kRISSE said:
I need the autonumber before I update a new record to
execute an afterupdate procedure to do a calculation that
gets placed into one of the record fields. I need to do
this because there are other tables that have some of the
pieces of the calculation.

In the macro that runs the query that calculates the value
I need, I am referencing the autonumber field as the
criteria.

If this is not possible, how else can I get the results I
need?

Hope this is enough information. Let me know if you need
more info.

Thanks!


Autonumber should have nothing to do with your calculation as it is
designed only to provide a unique identifier for records in a table.
This is used internally by Access in building relationships
between tables according to your design. The actual values that
Autonumber delivers are unimportant and should never be exposed to
users or have any external meaning at all. Depending on the design and
use of the database, Autonumber will develop gaps, become
random and go negative.

For any number series that you want to control or have available
externally, you must design your own. There are several schemes
available depending on what you want to do.

hth

Hugh
 
Sorry, I guess I wasn't clear.
I am calculating how may hours to charge a ballfield user
for lights on based on a table with date and time of day
the lights will turn on.

The use is entering a ballfield reservation for a
specific date, with a begin time and end time.

The duration may be 3 hours, but if the lights go on 1
hour into the reservation, they will be charged for two
hours of lights.

The user wants to see the total hours and the light usage
hours, so after they enter the end time, I need to look
up that date in the Lights table and calculate how many
light hours will be charged for this reservation.

Can you steer me in the right direction?


Thanks.
 
Back
Top