[AccessD] help - syntax for subform

Darren D darren at activebilling.com.au
Mon Feb 18 17:44:31 CST 2008


Hi Kath

I think    
strformname = "Forms!FrmPersonDetails!FrmSubformPeopleatWorkplace"
may need to become
strformname = "Forms!FrmPersonDetails.form.FrmSubformPeopleatWorkplace"
I added the .form. between your main form name and your subform name

Lemme know if this works or not
I think Darryl actually said something like this in answer to your post last
week but we were trying to make things generic rather than specific as we are
now - so it slipped past

There are also ways to make this generic by passing...
Me.Name & ".form." & strSubFormName - to build the full string
There are many ways to do this type of thing - this is just air code (from an
air head <grin>)

Ahem <clears throut> did anyone see the amazing aussies snatch victory from the
jaws of defeat the other night (Aimed Mainly at Stuart and Andy) <snigger>
Have a great day y'all
 
Darren
-----------------
T: 1300 301 731

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kath Pelletti
Sent: Tuesday, 19 February 2008 10:26 AM
To: Access D Normal List
Subject: [AccessD] help - syntax for subform

Can anyone help with syntax needed here.....

I have been working on a routine called SecureForm() which locks/disable
controls for any form which is passed to it.

The routine is called on each form's 'On Load' event and works fine for main
forms by passing the 'me.name' string.

I now need to add code to the OnLoad of the subforms as well .....so I need to
pass it the FULL name of the subform (including the full reference to the parent
name), not just the name of the subform itself.

I have been mucking around with the parent property with no luck so in the code
below I am trying to get around the error by actually typing in the name of the
subform but even that is giving me the same error.


------------------------------
Code is:

    'Call SecureForm function which locks controls, depending on which user
group is logged in.
    'strformname = Me.Name            'this works for main forms but not
subforms
    strformname = "Forms!FrmPersonDetails!FrmSubformPeopleatWorkplace"
    
    Call SecureForm(strformname)
----------------------------------------

Kath

______________________________________
Kath Pelletti
Software Design and Solutions Pty Ltd
Ph: 9505-6714
Fax: 9505-6430
kp at sdsonline.net
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.20.5 - Release Date: 14/02/2008 12:00 AM
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.20.5 - Release Date: 14/02/2008 12:00 AM
 




More information about the AccessD mailing list