I've built an Add-In that works great. Changed all instances of CurrentDb to CodeDb and was successful. I do, however, have a problem where I use DMax against a query to get the highest available number in a table. The purpose is to autogenerate unique number for problem reports. In subsequent processing I increment the strlastActionNbr by one and apply it. My problem is that this does not work on an Add-In even though it works fine otherwise. I'm trying to find a way of running the query using the CodeDb object and placing the value in strLastActionNbr. Anybody have any solutions?
strLastActionNbr = DMax("LongIR", "qryIncidentReports", "[ProjID] = " & "'" & .LstProjID & "'"
Note: LongIR is a numberic value using the full 4 characters of the year and concatenating it with the sequence number. 20010001
ProjId merely uses the value selected on the lstProjID listbox.
strLastActionNbr = DMax("LongIR", "qryIncidentReports", "[ProjID] = " & "'" & .LstProjID & "'"
Note: LongIR is a numberic value using the full 4 characters of the year and concatenating it with the sequence number. 20010001
ProjId merely uses the value selected on the lstProjID listbox.