[AccessD] Locking form controls 2003

Kath Pelletti kp at sdsonline.net
Tue Feb 12 22:03:07 CST 2008


.....aaahh....as usual as soon as I posted I think I found the 
answer......syntax now needs to be ctl.controltype, not ctl.type
..seems to be working now....

Kath

----- Original Message ----- 
From: "Kath Pelletti" <kp at sdsonline.net>
To: "Access D Normal List" <accessd at databaseadvisors.com>
Sent: Wednesday, February 13, 2008 2:56 PM
Subject: [AccessD] Locking form controls 2003


> Help please gurus.......trying to develop a routine which will lock (or 
> disable) controls on a form. (Access 2003)
>
> I am getting error 438 'Object doesn't support this property or method' on 
> the line 'Select Case ctl.type'.
>
> Any idea why? I am using code I have used in 2000. Can I no longer say 
> ctl.type?
>
> See code below:
>
> --------------------------------------------------------------------------------
>
>
> Code :
>
> Public Function LockControls(strformname As String)
> Dim frmIn As Form
> Dim strerrormsg As String
> Dim ctl As Control
> 'On Error GoTo Err_Handler
>
> Set frmIn = Forms(strformname)
>    For Each ctl In frmIn.Controls
>             Select Case ctl.Type                                    'error 
> occurs on this line............
>                 Case acTextBox: ctl.Locked = True
>             End Select
>    Next
>
> Normal_exit:
>    DoCmd.SetWarnings True
>    Exit Function
>
> Err_Handler:
>    MsgBox "Error: [" & Err.Number & "]  " & IIf(Len(strerrormsg) > 0, 
> strerrormsg, Err.Description), vbCritical, "Error Message"
>    Resume Normal_exit
> End Function
>
> ______________________________________
> 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
> 





More information about the AccessD mailing list