S
Steve S
I have a Data Entry Form that I use to enter new records to a table.
One field is CheckNo, it is a Number Field. Currently when I add a
record using this form the field starts off blank. What I would like
to have happen is for it to check the value of the last record entered
and if it is blank - leave it blank but if there is a number in the
last record entered I would like it to automatically come up with a
default value one higher.
I've been trying to do this by entering an expression in the default
value property of the text box of the form I am using to enter data.
From info I have found elsewhere I have been trying to use the
following expression:
=DLookUp("[CheckNo]","Empty","[ID]=Forms![DataEntryForm]![ID]+1")
CheckNo is the name of the Number Field in the Table
Empty is the Name of the Table
DataEntryForm is the name of the Form
I figured I would first tackle just getting it to increment the fileld
and that then I would tackle adding the logic of leaving it blank if
the record before is blank.
I keep getting Error Messages of #Error and/or #Name when I try to use
this and variations of this.
Any ideas?
Thanks
One field is CheckNo, it is a Number Field. Currently when I add a
record using this form the field starts off blank. What I would like
to have happen is for it to check the value of the last record entered
and if it is blank - leave it blank but if there is a number in the
last record entered I would like it to automatically come up with a
default value one higher.
I've been trying to do this by entering an expression in the default
value property of the text box of the form I am using to enter data.
From info I have found elsewhere I have been trying to use the
following expression:
=DLookUp("[CheckNo]","Empty","[ID]=Forms![DataEntryForm]![ID]+1")
CheckNo is the name of the Number Field in the Table
Empty is the Name of the Table
DataEntryForm is the name of the Form
I figured I would first tackle just getting it to increment the fileld
and that then I would tackle adding the logic of leaving it blank if
the record before is blank.
I keep getting Error Messages of #Error and/or #Name when I try to use
this and variations of this.
Any ideas?
Thanks