Gustav Brock
Gustav at cactus.dk
Wed Sep 27 03:24:05 CDT 2006
Hi John 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 >>> john at winhaven.net 27-09-2006 06:35 >>> This must be something I'm simply not seeing. Why doesn't this work as the default value for a textbox on a popup form? = (DMax("[ItemNumber]", "tblJobDetail", "[JobNumber] = " & [Forms]![frmProject]![txtJobNumber])) + 1 ItemNumber is Integer JobNumber is Text TIA John B.