UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Run Time Error 3075, Access 2010    
 
   
habiler
post Dec 20 2017, 02:38 AM
Post#1



Posts: 60
Joined: 6-August 15



What's Matter with my code.
He gives me an error time 3061 Expected 1 or 3075 (In this case 3061)

What's wrong with my code.

CODE
Function ChildLT12YbyPerson(Matr As Long, DateNaiss As Date)

Dim rs3 As DAO.Recordset
Dim strSQL3 As String
Dim CountOfBirthdates As Integer



    strSQL3 = "SELECT EMPLOYEENBR, Count([BIRTHDATE]) AS CountofBirthdates FROM Enfts  WHERE BIRTHDATE >= DateAdd(YYYY, -12, #01/01/2000#) and EMPLOYEENBR = " & Matr & " GROUP BY EMPLOYEENBR  "
    Set rs3 = CurrentDb.OpenRecordset(strSQL3)
Debug.Print strSQL3
    With rs3
        If Not (.EOF And .BOF) Then .MoveFirst
        While Not .EOF
         ' While Not LT12Y > 11
    
      ChildLT12YbyPerson = CountOfBirthdates
            .MoveNext
           ' Wend
        Wend
        
        .Close
        Debug.Print "Enfants = :"; Matr, DateNaiss, ChildLT12YbyPerson
    End With
    
    Set rs3 = Nothing
End Function
Go to the top of the page
 
Doug Steele
post Dec 21 2017, 12:17 PM
Post#2


UtterAccess VIP
Posts: 21,552
Joined: 8-January 07
From: St. Catharines, ON (Canada)


Try DateAdd('YYYY', -12, #01/01/2000#) (or DateAdd(""YYYY"", -12, #01/01/2000#))

--------------------
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    21st January 2018 - 03:39 PM