Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Bracketing 3

Status
Not open for further replies.

lars7

Technical User
Aug 16, 2005
817
GB
Hi,
Could anyone tell me whats wrong with this code Im getting a Invalid backeting of name msg.

SELECT tblassimilation.PayNumber, tblassimilation.Name, tblassimilation.Asslettersigned, tblassimilation.Assletterreceived, tblassimilation.GroupCode, tblassimilation.PayPoint
FROM tblassimilation
GROUP BY tblassimilation.PayNumber, tblassimilation.Name, tblassimilation.Asslettersigned, tblassimilation.Assletterreceived, tblassimilation.GroupCode, tblassimilation.PayPoint
HAVING (((tblassimilation.Assletterreceived) Is Null) AND ((tblassimilation.GroupCode)=[forms]![frmjedswitchboard]![cbo5Column(1)]) AND ((tblassimilation.PayPoint)=[forms]![frmjedswitchboard]![cbo5.Column(2)]))
ORDER BY tblassimilation.Name;
 
cbo5.column(?) is not a field and should not be bracketted. Try removing the square brackets from those .column(?) references.
 
You can't use the Column property of a ComboBox or ListBox object in a query's parameter.
A workaround is to have hidden TextBox populated just before lauching the query.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
If this is a stored query, you could use the Eval function.

[tt]... tblassimilation.GroupCode=Eval("[forms]![frmjedswitchboard]![cbo5].Column(1)") ...[/tt]

- but then - if it is a stored query, why is it here, and not in the query forum ([ignore]forum701[/ignore])?

Roy-Vidar
 
Thanks for all the responses, I was hoping to keep my original idea but if that isn't possible then I will go with plan B, I had started to look at an alterative way with 2 text boxes I guess I will continue with that.

Thanks as always your help and advice is always appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top