Currently I'm using the following code to look up a value in my table:
I want to change the code to look up the most recent entry based on the "Date/Time" field instead of "ID", but I'm having a syntax error. I believe that I need to put some #'s somewhere, but I can't get it right.
How do I fix this?
My second question is this: The code above should look up the "most recent" data entered because the field is setup on a [Ni-Au-Date/Time]= Now routine. How do I modify the code so that is looks up previous values that are not the maximum time/date value. ie: How do I look up the value that is the 2nd most recent?
Any information would be much appreciated!
Code:
Point1 = DLookup("[Ni-Au-Nickel Thickness Avg]", "Ni-Au-CooperSubformQuery", "[ID]=" & DMax("[ID]", "Ni-Au-CooperSubformQuery"))
I want to change the code to look up the most recent entry based on the "Date/Time" field instead of "ID", but I'm having a syntax error. I believe that I need to put some #'s somewhere, but I can't get it right.
Code:
Point1 = DLookup("[Ni-Au-Nickel Thickness Avg]", "Ni-Au-CooperSubformQuery", "[Ni-Au-Date/Time]=" & DMax("[Ni-Au-Date/Time]", "Ni-Au-CooperSubformQuery"))
My second question is this: The code above should look up the "most recent" data entered because the field is setup on a [Ni-Au-Date/Time]= Now routine. How do I modify the code so that is looks up previous values that are not the maximum time/date value. ie: How do I look up the value that is the 2nd most recent?
Any information would be much appreciated!