var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Find Second Most Recent Date
I'm pretty new to VBA, i'm trying to fill out a form using information from the most recent date and the next most recent date of a table. I need the name of the table to be a variable, which seems to be causing problems. Right now i have
Dim StudentName As String
MostRecentDate = DMax("TestDate", StudentName)
NextDate = DMax("TestDate", StudentName, "TestDate <> MostRecentDate")
The mostrecentdate works, the second works if the name of the domain is not a variable. There will never be duplicate dates, i'm not worried about it skipping entries with the same date.
Right now, each student has a table with test date rows, and test type columns. I need the dates so i can scan through the table with
Do Until .EOF
For Each fldTestDate In .Fields
If fldTestDate.Name = "TestDate" Then
If fldTestDate.Value = MostRecentDate Then
'fill form with info from this row
It should be:
The way your code is written, MostRecentDate is litteral as it is included in quotes.
NextDate = DMax("TestDate", StudentName, "TestDate <> #" & MostRecentDate & "#")
Have a nice day!
thank you so much, i hoped it was something easy like that
Tags for this Thread