Full Version: (ScottGem) ERROR#
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
nalym
HI!! I got in this morning and opened up my database. When the form where the M5250001 comes up the first time...in that space it gives an error message. Then when I close it and open it up on my own it works. Do you know why?
ScottGem
You probably aren't using Nz function as we told you so the first record of the day returns a Null which causes the error.
nalym
This is in the txtPrefix:
="M" & Format(Date(),"mdd")

This is in the txtIncrement:
=nz(DMax("[Increment]","InputTable","[Prefix] = '" & "M" & Format(Date(),"mdd") & "'"),0)+1

I have a form(switchboard) that comes up first....then the form to input (where the number is displayed) can be choosen. Do you think if I put the txtPrefic and txtIncrement on the first one then call it from the second one...then it will work?
ScottGem
The Switchboard should be a navigation form. You want this on the form where you enter new records only. What control is showing the error?
nalym
it won't so it now...I think it only does it the first time of each new day
ScottGem
If it only happens on first time then txtIncrement is returning a null
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.