Here's the problem:
You've got a table for your Products
and a field ProdID which you want to be an Autonumber.
You also want the ProdID to start at 1001 for each unique Category and Sub-Category grouping.
Then the data would probably look like:
Cat Sub-Cat Prod
1001 101 1001
1001 101 1002
1001 101 1003
1001 102 1001
1002 101 1001
In this case the ProdID can NOT be a autonumber. Autonumber fields require a unique index. You would be duplicating ProdID numbers for each unique Category and Sub-Category combination.
May I make a suggestion:
Change those fields that would have duplicate values to number fields (long).
Have your form's ProdID text box control's default value property do something like this:
=Nz(DMax("[ProdID]", "ProductTable", "[CatID]=" & CatID & " AND [SubCatID]=" & SubCatID),0) + 1
The DMax() function will return the highest ProdID number for the given CatID and SubCatID; or it will return a NULL if it can not be found. To handle the nulls, the output of the DMax() function is sent as the arguement for the Nz() function, Nulls-to-Zero function. Therefore, you will either get a max number for the ProdID or a zero. Finally add one to that number. (Gotta love those composite function statements.)