By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,908 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

getting error message while running a query from a form

P: 84
Our Database stores event messages in a table called eventnotifications. The table has a message type column. There are two types of messages (alert or info). I have created a form that includes a list box. The list box contains the following (alert, info, both). The ID for each value is hidden from the operator. alert has an ID of 1, info has an ID of 2 and both has an ID of 3. The list box value is passed to a query. The query is lanuched using a control on the form. Below I have listed the criteria of the query.

IIf([forms]![Message Screen]![messagetype]=1,"alert",IIf([forms]![Message Screen]![messagetype]=2,"info",IIf([forms]![Message Screen]![messagetype]=3,("alert" Or "info")," ")))

If the operator selects alert or info the correct data is displayed. If the operator selects both I am getting an error message "you canceled your previous action" Any idea's why I am getting this error?
May 7 '07 #1
Share this Question
Share on Google+
2 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
You have posted this in the Articles section. I am moving it to the Access forum.

ADMIN
May 7 '07 #2

JConsulting
Expert 100+
P: 603
Our Database stores event messages in a table called eventnotifications. The table has a message type column. There are two types of messages (alert or info). I have created a form that includes a list box. The list box contains the following (alert, info, both). The ID for each value is hidden from the operator. alert has an ID of 1, info has an ID of 2 and both has an ID of 3. The list box value is passed to a query. The query is lanuched using a control on the form. Below I have listed the criteria of the query.

IIf([forms]![Message Screen]![messagetype]=1,"alert",IIf([forms]![Message Screen]![messagetype]=2,"info",IIf([forms]![Message Screen]![messagetype]=3,("alert" Or "info")," ")))

If the operator selects alert or info the correct data is displayed. If the operator selects both I am getting an error message "you canceled your previous action" Any idea's why I am getting this error?

Your criteria for that field has no logic to handle multiple selections...and is not allowed. Set your listbox control to be single selection only to get rid of the problem.
J
May 7 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.