Can't set recordsource property of subform

T

Tom Stoddard

I have a FE/BE that I've secured the way I want. Everything seems to be set
up correctly but I have one problem.

One form is a complex form with two subforms. It ran very slow over the LAN
so I had to remove the recordsource property from the subforms and then load
them back in using code in the main form's OnLoad event. That solved the
slowness but created a new problem. This form displays data which certain
user have read only permissions for which is set on the tables in the BE
database. For some reason, those users can't open the form without getting
an error stating the there's been an invalid reference made to the subform's
form/report property. After that, the form loads but it's blank. If I give
those users update, insert and delete permission to the tables that the
query I'm using as the recordsource is based on, then everything works fine.
Other users with those permissions can also use the form with no problem.

I've tried changing permissions on every object involved and the only thing
that makes a difference is the permission that the user has on the BE
tables. I've even made all queries snapshot type and set all forms
recordsettype properties to snapshot and it still won't let the user load
the form unless I grant them permission to change data in the tables. I even
tried to change the queries to RWOP and that didn't work. I've searched
online and found a few references to people who have reported similar
problems but I can't find an explanation. Can anyone explain this to me and
offer a work around? I don't want these users to have read write access to
these tables but I want them to be able to view the data.

In case it matters, the code I'm using the set this property is:
Me.mySubFormControl.Form.RecordSource = "qryMyQuery"
 
T

TC

Tom said:
For some reason, those users can't open the form without getting
an error stating the there's been an invalid reference made to the subform's
form/report property.

Show the exact error message & the exact line of code on which the
error occurs. Otherwise we all waste time guessing!

HTH,
TC
 
T

Tom Stoddard

Show the exact error message & the exact line of code on which the
error occurs. Otherwise we all waste time guessing!

Error message is: Run-Time error '2455' - You entered an expression that has
an invalid reference to the property Form/Report.

Line of code causing error:
Me.subPriceLines.Form.RecordSource = "qryPriceLineSub"

I'm using Access 2003. This error does not occur if I log in as any user who
has read/write permissions on the underlying tables.

TC,
I've been experimenting trying to figure this out and I think I'm going to
need to redesign this form anyway. If I comment out the line of code that's
causing the error and put the recordsource back into the property sheet of
the subform, the main form opens without error but the users without full
permissions to the underlying tables just get a blank form. I'm not sure why
but like I said, it's a complex form and I created it by copying a form that
is used to edit the information that's displayed.

Is there something I need to know about creating forms with subforms that
are based on tables that the some users will only have read permissions on?

Thanks!
 

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