Hope you don't mind but I am having a problem doing a similar Macro, but am getting a syntax error.
Here is the Expression:
DLookUp("INVNUM ","INVOICE" ,"[ LatestRevisionD ate] = " & DMax("LatestRev isionDate","INV OICE"))
The only difference from the successful (thanks to you) expression:
DLookUp("BFNAME ","REGISTER ","[REGID] = " & DMax("REGID","R EGISTER"))
Is that REGID is a number, where LatestRevisionD ate is a Date/Time DataType with a General Date format.
Any suggestions as to how I might alter my expression?
Thanks
Sorry I'm not liimra whose giving you the code. :)
Is the date format the same as recordset you are getting from? Error may occurs if the date format are different. So just in case the you can add format() to the code.
To reuse last input could you not just assign the value of entered fields to variables when you exit that control, then have a command button which when clicked cycles through controls assigning saved variables? each time the form is filled in you get a new set of variables and simply clicking command button on next form entry populates form with valuse from previous entry?
Remember, I am seeking the INVNUM associated with the greatest value of the "LatestRevision Date" in the INVOICE Table.
Is it possible that the DMax function will not work with a record that is in the General Date format? If not, what similar function is available to do the same thing? Perhaps something like DLAST??
Thanks for your ongoing assistance.
Comment