ellandrd
asked on
AfterUpdate event error Urgent 500 points
have a combo box on a form the has an afterupdate event that populates an other combo box on a subform
The after update is below
I have ran the select statement in a querry and it works when i manualy enter the number.
The error i get syntax error (missing Operator) in querry expression 'tblCost.PersonnelID Where (tblCost.PersonnelID)= 1'.
Me!fsubTimeEntry!cboCostRa teId.RowSo urce = "SELECT tblRateTypes.RateDescripti on, Max(tblCost.CostId) AS CostId, tblCost.RateID, Max(tblCost.Rev) AS MaxOfRev, Max(tblCost.Rate) AS MaxOfRate, tblCost.PersonnelID FROM ((tblCost LEFT JOIN tblEmpTerm ON tblCost.EmpTermID = tblEmpTerm.EmpTermID) LEFT JOIN tblPersonnel ON tblCost.PersonnelID = tblPersonnel.PersID) LEFT JOIN tblRateTypes ON tblCost.RateID = tblRateTypes.RateId GROUP BY tblRateTypes.RateDescripti on, tblCost.RateID, tblCost.PersonnelID WHERE(tblCost.PersonnelID) = " & Me.cboPersonnelID
So the querry works but i cant get it to work with the form and subform
The after update is below
I have ran the select statement in a querry and it works when i manualy enter the number.
The error i get syntax error (missing Operator) in querry expression 'tblCost.PersonnelID Where (tblCost.PersonnelID)= 1'.
Me!fsubTimeEntry!cboCostRa
So the querry works but i cant get it to work with the form and subform
ASKER
put the space in still the same error
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Awsome thank you but i havnt seen that before where the WHERE has to move.
Any reason why?
Any reason why?
Glad I could help,
To answer your question, here is the format for sql statments. If it is not in this order you will get an error
Select
From
Join
on
Where
Group by
Having
Thanks for the points/grade.
-David251
To answer your question, here is the format for sql statments. If it is not in this order you will get an error
Select
From
Join
on
Where
Group by
Having
Thanks for the points/grade.
-David251
In the code you posted there is no space after WHERE. If that's the case in your real query then add one.
Pete