RWOP make table Query

G

Gwen

Hi,

Please help.

I need to create a RWOP make table query. The criteria of
the query is based on the groups the user belongs. It is
my understanding that RWOP queries will only work with
saved queries only. Any idea how I can get the criteria
into a saved query. The name of the make table is user
dependent too.
Below is some of the code I attempted to use.

For i = 0 To usr.Groups.Count - 1
grpname = usr.Groups(i).Name
strcriteria = strcriteria & "= """ & grpname & """ or "
strcriteria = strcriteria & varname
Next i

For i = 0 To usr.Groups.Count - 1
grpname = usr.Groups(i).Name
allgrpnames = allgrpnames & "_" & grpname
Next i

allgrpnames = Right$(allgrpnames, Len(allgrpnames) - 1)

strsql = "SELECT demographic.* INTO [" & allgrpnames & "]
from Demographic"
strsql = strsql & " WHERE(" & strcriteria & ")with
owneraccess option;"

Your help would greatly be appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top