Hi, I wonder if any one could help with the following SQL statement.
SELECT ConsultantSkills.[Consultant Name]FROM ConsultantSkills INNER JOIN AdditionalSkills ON ConsultantSkills.[Consultant Name]=AdditionalSkills.[Consultant Name]WHERE ConsultantSkills.LoadRunner>=1<=5 And AdditionalSkills.PVCS>=1<=5;
If I run the above code in the SQL editor in Access 2007 it produces the correct number of results (5 items). However when I run the same SQL from within a VBA function (below) it only returns one value even though it should have 5 listed as it does when run in Access alone. I would appreciate any help.
Dim dbase As DAO.Database
Dim RecSet As DAO.Recordset
Set dbase = CurrentDb
Set RecSet = dbase.OpenRecordset("SELECT ConsultantSkills.[Consultant Name]FROM ConsultantSkills INNER JOIN AdditionalSkills ON ConsultantSkills.[Consultant Name]=AdditionalSkills.[Consultant Name]WHERE ConsultantSkills.LoadRunner>=1<=5 And AdditionalSkills.PVCS>=1<=5;")
For b = 0 To RecSet.Fields.Count
MsgBox RecSet.Fields(b).Name
Next
dbase.Close
Set dbase = Nothing
Set RecSet = Nothing
End Function
SELECT ConsultantSkills.[Consultant Name]FROM ConsultantSkills INNER JOIN AdditionalSkills ON ConsultantSkills.[Consultant Name]=AdditionalSkills.[Consultant Name]WHERE ConsultantSkills.LoadRunner>=1<=5 And AdditionalSkills.PVCS>=1<=5;
If I run the above code in the SQL editor in Access 2007 it produces the correct number of results (5 items). However when I run the same SQL from within a VBA function (below) it only returns one value even though it should have 5 listed as it does when run in Access alone. I would appreciate any help.
Dim dbase As DAO.Database
Dim RecSet As DAO.Recordset
Set dbase = CurrentDb
Set RecSet = dbase.OpenRecordset("SELECT ConsultantSkills.[Consultant Name]FROM ConsultantSkills INNER JOIN AdditionalSkills ON ConsultantSkills.[Consultant Name]=AdditionalSkills.[Consultant Name]WHERE ConsultantSkills.LoadRunner>=1<=5 And AdditionalSkills.PVCS>=1<=5;")
For b = 0 To RecSet.Fields.Count
MsgBox RecSet.Fields(b).Name
Next
dbase.Close
Set dbase = Nothing
Set RecSet = Nothing
End Function