bulldawg15
Programmer
I am creating a database that should be fairly simple. The database is for a local racetrack and I'm stuck on how to enter in race results. I have four tables: Driver, Rank, Home, Class. The form to enter in the results contains a main form with a subform. On the main form there are two combo boxes, one to select the Class of the race, and one to select the Heat of the race: i.e Finals, 1, 2, 3. The subform currently has a text box containing the rank of the driver for that race and the driver's name. I want the Rank to automatically start at one and increase by one each time a new driver is added. The rank field is part of the primary key but cannot be an autonumber field because there will be multiple ranks in the rank table. The rank table contains a primary key of: Class_ID, Rank, Heat. Therefore, each class/heat combo needs to start at 1 and increase. I created a query that finds the max rank value of the class/heat combo and I thought I could use that value +1 for the default value of the Rank field but I'm not having any luck. If it would be easier doing it some other way than using the query that is fine to. I'm open to anything that works. I also want the Driver combo box in the Rank form to be limited to only contain drivers whose Class_ID matches that of the selected class in the main form. I have the row source set up sot that it works when I make my first selection when entering the form but not when I change the selected class and I do have an After_Update event set for requerying. It seems this should be so simple but I'm just missing something. Thanks in advance for your help!