P
Paul James
I have a subform based on a table that has of a two-field primary key
(LicenseeID and AgentID).
The subform is linked to the main form through the LicenseeID fields. My
question concerns how to handle the AgentID field when I add a new record in
the subform.
When I add a new record in the subform, the Licensee ID field will
automatically be set to the Licensee ID in the main form. For the AgentID
field, I would like to set it equal to the highest existing AgentID field
plus 1. I tried putting the formula "=Max("AgentID")+1" in the Default
Value property of the AgentID field, but that didn't work, because when I
add a new record, the AgentID field continues to display the value that was
in the last record, and doesn't add the 1.
So how do I get that field to take the value of the maximum existing AgentID
field + 1 when I add a new record in my form?
(If possible, I'd prefer to do it with a simple formula rather than using
DAO or ADO to accomplish this).
Thank you in advance.
(LicenseeID and AgentID).
The subform is linked to the main form through the LicenseeID fields. My
question concerns how to handle the AgentID field when I add a new record in
the subform.
When I add a new record in the subform, the Licensee ID field will
automatically be set to the Licensee ID in the main form. For the AgentID
field, I would like to set it equal to the highest existing AgentID field
plus 1. I tried putting the formula "=Max("AgentID")+1" in the Default
Value property of the AgentID field, but that didn't work, because when I
add a new record, the AgentID field continues to display the value that was
in the last record, and doesn't add the 1.
So how do I get that field to take the value of the maximum existing AgentID
field + 1 when I add a new record in my form?
(If possible, I'd prefer to do it with a simple formula rather than using
DAO or ADO to accomplish this).
Thank you in advance.