I have a form that allows users to select criteria for a report. One of
the controls on the form is a multi-select list box. Using the MS
Knowledge Base, I wrote my code to pull the items from the list and
make a querydef for the report. Everything runs great for me but if I
log on as one of my users, I get the "You do not have the necessary
permissions to use the "myquery" object" error. I have given the users
modify permission on this query. The saved query is a RWOP query. I
even tried giving the users administer permissions on the query and it
still will not run. Can anyone tell me what I am doing wrong?
After building the SQL string I run the following:
Set DB = CurrentDb()
Set Q = DB.QueryDefs("myquery")
Q.SQL = strSQL
Q.Close
Set Q = Nothing
Set DB = Nothing
DoCmd.OpenReport "myreport", acViewPreview