werafa
05-09-2017, 05:29 AM
Hi all,
I had this working - and now it is broke.
can anyone advise whether my SQL syntax is wrong or whether I need to look elsewhere?
sSQL = "SELECT Organisations.OrgCode " & _
"FROM Staff INNER JOIN Organisations " & _
"ON Staff.Org = Organisations.Id " & _
"WHERE Staff.cName = '" & myPerson & "'"
My Organisations table has fields:
ID (PK)
OrgName
OrgCode
My Staff Table has fields that include:
ID (PK)
cName (calculated Field)
Org (linked to Organisations.ID)
myPerson is a string variable that should = cName for one record
Thanks
Werafa
I had this working - and now it is broke.
can anyone advise whether my SQL syntax is wrong or whether I need to look elsewhere?
sSQL = "SELECT Organisations.OrgCode " & _
"FROM Staff INNER JOIN Organisations " & _
"ON Staff.Org = Organisations.Id " & _
"WHERE Staff.cName = '" & myPerson & "'"
My Organisations table has fields:
ID (PK)
OrgName
OrgCode
My Staff Table has fields that include:
ID (PK)
cName (calculated Field)
Org (linked to Organisations.ID)
myPerson is a string variable that should = cName for one record
Thanks
Werafa