Subform - Changing source object in code

A

Adrian Jansen

Hi,

Not sure if this belongs in Formscoding or Security, but here goes:

Using Access 2002.

I have a secured database, standard Fe/Be setup, with some forms in the Fe
which have multiple subforms on tabs. To speed loading, I set the source
object of each subform control in code as the user clicks on the tab.
Typical code:

Private Sub TabCtl60_Change()

Select Case Me.TabCtl60.Value
Case 0
'first tab code must be loaded with main
'Me.subContactAddress.SourceObject = "subContactAddress"
Case 1
'2nd tab code
Me.subContactOrg.SourceObject = "subContactOrg"
Case 2
Me.subMailout3.SourceObject = "subMailout2"

Case 3
Me.subEducationProgress.SourceObject = "subEducationProgress"
Case 4
Me.subNetwork.SourceObject = "subNetwork"
Case 5
Me.frmResources.SourceObject = "frmResources"
Case 6
Me.subContactSource.SourceObject = "subContactSource"
Case 7
Me.subStatus.SourceObject = "subStatus"
End Select

End Sub

This works fine when logged on as owner or admin, but when a user logs on
with only data read/write permissions, we get an error 2614 "You dont have
permission to insert this form into another form". I really dont want to
give ordinary users design permissions on this form, but it seems the only
way to get past this and still preserve the fast loading.

Any ideas welcome.
--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 

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