Type mismatch, error '13'

emsadoon

Registered User.
Local time
Yesterday, 23:12
Joined
Jun 6, 2013
Messages
83
I have written the following function in a module to query for a name. But I get an error (Type mismatch error '13') regarding line
Code:
ApplicantNameQuery = rstTest![Applicant Name]

Code:
Public Function ApplicantNameQuery() As Integer
    Dim strQuery As String
    Dim dbs As DAO.Database
    Dim rstTest As DAO.Recordset
    Dim db As Database
   
                   strQuery = " SELECT ProjectT.Project_ID, [ApplicantFirstName] &' '& [ApplicantLastName] AS [Applicant Name]" + _
                    "FROM ApplicantT INNER JOIN ProjectT ON ApplicantT.Applicant_ID = ProjectT.Applicant_ID;"
                        

           
    Set db = CurrentDb
    Set rstTest = db.OpenRecordset(strQuery)
    
    ApplicantNameQuery = rstTest![Applicant Name]
    
    

End Function
 
This means that the left hand side is square and right hand side is round, so they don't fit.

Now how could that be :D
 
Do you see what spike is saying? You declared ApplicantNameQuery as an integer. What type are you trying to assign to it?

Anyone? Anyone? Bueller?
 

Users who are viewing this thread

Back
Top Bottom