[AccessD] DMax issue

Gustav Brock Gustav at cactus.dk
Wed Sep 27 12:54:06 CDT 2006


Hi John

Then you can reduce to:

= "'" & DMax("[ItemNumber]", "tblJobDetail", "[JobNumber] = '" &
[Forms]![frmProject]![txtJobNumber] & "'") + 1 & "'"

/gustav


>>> john at winhaven.net 27-09-2006 19:47:54 >>>
Thanks Gustav,
Since Events prior to this make sure the text box is not null there should
never be a time when JobNumber's text box is null or I would defintetly use
this.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock

If JobNumber is text, you need to wrap the value in single quotes.
Also, if your textbox may be Null, and DefaultValue should be a String.
Thus, try this:

= "'" & Nz(DMax("[ItemNumber]", "tblJobDetail", "[JobNumber] = '" &
[Forms]![frmProject]![txtJobNumber] & "'"), 0) + 1 & "'"

/gustav




More information about the AccessD mailing list