Forum Discussion

BrianGuiney's avatar
BrianGuiney
Copper Contributor
Feb 09, 2022

Issue with creating a data entry form using dmax - doesn't pick up value

 

Hi all,

 

I'm creating a simple data entry for that is used to add new data to a pre-created table

 

I create the form and set the property to data entry

 

I've added the code for DMAX/I've tried DCount too

 

=DMAX("PupilID","tblPupil")+1

 

this finds the largest pupil number and adds one

 

I've done this before and never had the issue but it is giving an error message (see below) 

 

I have 13 records - the dmax finds the largest and then adds one on

 

it automatically shows 14 but as soon as I add another field and try to go to design view or save it thinks there is no value in the ownerID field

 

I've tried different number formats, key on, key off, delete relationships etc but no joy - any help greatly appreciated

 

 

    • BrianGuiney's avatar
      BrianGuiney
      Copper Contributor
      Hi - I do have records - I think this is an issue with my version of access

      previously the ID was generated with an expression in the control source - I added it to default value and it works - useful tip above anyway thanks

Resources