Link to home
Start Free TrialLog in
Avatar of bob-hytekltd
bob-hytekltd

asked on

4 table join in VB6 MS access

I've been doing some looking and have found a number of topics that address my issue of joining 4 tables from an MS access db in VB6 but none work.  I still get a "too few parameters, 1 expected" error.  It's driving me crazy.  I've put the latest code below but it still gives me that error.  I feel I've been in a big circle.

Can anyone point out what I'm doing wrong?

Thanks,
bob...
======
P.S. I didn;t know how to go back and add to my previous question so I added a new one here.
strsql = "SELECT [Qualifications].*, [QualificationCourses].*, [Roster].*, [Arms].* "
        strsql = strsql & " FROM ((( Qualifications "
        strsql = strsql & " INNER JOIN QualificationCourses ON Qualifications.[CourseID] = QualificationCourses.[ID]) "
        strsql = strsql & " INNER JOIN Roster on Qualifications.[AgentID] = Roster.[ID])"
        strsql = strsql & " INNER JOIN Arms on Qualifications.[ArmsID] = Arms.[ID]) "
        strsql = strsql & " WHERE [Qualifications].License = '" & Trim(userAdminMOD.currentUser.license) & "'"

Open in new window

Avatar of ralmada
ralmada
Flag of Canada image

try like this
strsql = "SELECT [Qualifications].*, [QualificationCourses].*, [Roster].*, [Arms].* "
strsql = strsql & " FROM Qualifications "
strsql = strsql & " INNER JOIN QualificationCourses ON Qualifications.[CourseID] = QualificationCourses.[ID] "
strsql = strsql & " INNER JOIN Roster on Qualifications.[AgentID] = Roster.[ID]"
strsql = strsql & " INNER JOIN Arms on Qualifications.[ArmsID] = Arms.[ID] "
strsql = strsql & " WHERE [Qualifications].License = '" & Trim(userAdminMOD.currentUser.license) & "'"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of rockiroads
rockiroads
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bob-hytekltd
bob-hytekltd

ASKER

Thanks to all that replied.  The problem was in the spelling of one of the field names (I've only been writing this code for 18 years) but the suggestion to not use INNER JOINS was brilliant and I learned a new way of creating SQL statements this way.  A LOT simplier!!!  Thanks again everyone.  Experts Exchange is great... and so are all of the experts who participate!!!
Best to All!
bob...
======
In case you all didn't catch my humor... I misspelled "simpiler".
Best,
bob...
=======