Max() is not in the basic libraries.
Do you have a Max()?
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Nick" <(E-Mail Removed)> wrote in message
news:78906E7F-8626-413E-9AC2-(E-Mail Removed)...
>I recently changed jobs and I'm trying to run a database I used a few years
> ago. I haven't changed a thing, and I'm getting a compile error when I
> first
> open it on the following code:
>
> The Compile error points to the Max function below...
>
> Public Function DateConfigure(MaxMasterTableRowDate As Date)
>
> Dim CMSrst As DAO.Recordset
> Dim db1 As DAO.Database
> Dim MaxDateInSourceData As Date
>
> 'check table name
> Set db1 = CurrentDb()
>
> Set CMSrst = db1.OpenRecordset("root_hsplit", dbOpenDynaset)
>
> MaxDateInSourceData = Max(CMSrst.Fields(0)) ' --> Compile error here....
>
> If MaxMasterTableRowDate = MaxDateInSourceData Then
> DateConfigure = MaxMasterTableRowDate
> Else
> DateConfigure = MaxDateInSourceData
> End If
> End Function
>
> I can't figure out why?? I have all of the basic references setup, and
> none
> are labeled "MISSING". Someone please advise?
>
> Thanks,
> Nick