
Signature
Access 2000 User, Thanks in advance Bobbye
Hi Bobbye
I suspect the first problem is being caused by a timing glitch. I think the
subform is opening before [JOBNO] on the main form has a value.
The second problem is for the same reason: for a new record, [JOBNO] is
null.
So in both cases your criteria string simply says "[jobnumber]=", which is
invalid.
Try using this expression instead:
=Nz(DMax("[ReportNumber]","tblPWreportLog",
"[jobnumber]=Nz(Forms!frmJobs![JOBNO],0)"), 0) + 1

Signature
Good Luck :-)
Graham Mandeno [Access MVP]
Auckland, New Zealand
>I have a job form with a subform that numbers the reports submitted for
>each
[quoted text clipped - 15 lines]
> thought
> was my default) I get #Error.
Bobbye R - 23 May 2008 04:58 GMT
Hi Graham,
I entered the expression you wrote (I'm afraid I don't understand nz or what
the zero stand for but I'll look it up tomorrow)
I still get an error when I initially open the form. (I'll keep trying
there too.)
When I enter a new job on the main form the reportnumber on the subform =
#Error and when I input info on the subform the reportnumber changes from
#Error to 0 instead of 1. Any other suggestions?

Signature
Access 2000 User, Thanks in advance Bobbye
> Hi Bobbye
>
[quoted text clipped - 30 lines]
> > thought
> > was my default) I get #Error.
Jan Baird - 27 May 2008 20:51 GMT
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.