Auto-updating fields

  • Thread starter Thread starter Delameko Stone
  • Start date Start date
D

Delameko Stone

I'm pretty new to this, but can anyone help with the code
needed to automatically update a field in the next record.

First, a number that will transferred from the previous
record. So if I change it in one of the records all the
ones I create directly after that will use the same
number.

Secondly, a number that increments with each record.

But also, these are for nested tables and they have to
start from 1 again each time I add to the nested table
from the main.


If it helps, this is for a Music database. The number
that stays the same until I change it will be the disc
number, and the one that increments will be the track
number...


Thanks in advance to anyone that can help a n00b out.
Cheers.
 
This is something that would be accomplished at form/module level and not at
table level. Your tables would likely be set up as such:

tblDisc
===========
lngDiscID
strDiscName

tblTracks
===============
lngTrackID
lngDiscID
strTrackName

Your tables would be related as One-to-Many on lngDiscID ...

You would likely have a parent/child type form (a form/subform setup) with
the main form based on tblDisc and the subform based on tblTracks. Possibly
use a datasheet view for the subform.

If I'm not mistaken, there was a sample database that was very similar to
this. If you didn't install the samples, you can rerun setup and do so, or
possibly download them at the Microsoft website.
 
Back
Top