using access 2000. Have a form based on a couple of controls, it
finds the last used Inquiry number in a table. So it finds the
highest Inquiry number for the "Office" , "Company" and "YearStamp"
selected by the user.
Code below:
=IIf(IsNull(DMax("[Inquiry Number]","Inquiry","[Office] = '" &
[Form]![Office Code] & "' and" & "[Company] = '" & [Form]![Company
Code] & "' and " & "[YearStamp] = " &
[Form]![Year])),0,DMax("[Inquiry Number]","Inquiry","[Office] = '" &
[Form]![Office Code] & "' and" & "[Company] = '" & [Form]![Company
Code] & "' and " & "[YearStamp] = " & [Form]![Year]))
I use to just use the DMax but had to change it to an IIF because of
nulls. But this code simply places #ERROR in the control when it is
null.
Am I doing something wrong? Wait obviously I am doing something
wrong. Can someone lead me in the right direction.
I'm doing this iif statement in the control source property.