dbTalk Databases Forums  

Error 438

comp.databases.ms-access comp.databases.ms-access


Discuss Error 438 in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
BobbyDazzler
 
Posts: n/a

Default Error 438 - 01-23-2012 , 09:57 AM






For Each ctl In Me.Controls
If ctl.Tag = "add" Then
ctl.Enabled = True
ctl.Locked = False
Else
End If
Next

In the Form_Current event I have some code which checks a date and
either locks and disables or unlocks and enables various controls
wherever they have "add" assigned as their Tag property. This code
has worked well for over 4 years without issue. I have been making
some amendments to the form, I have added another command button which
adds some functionality. I have made no amendments to the
Form_current coding, nor have I changed the Tag property of any of the
controls, yet I am getting an error 438 object doesn't support this
property or method, any ideas?

Reply With Quote
  #2  
Old   
BobbyDazzler
 
Posts: n/a

Default Re: Error 438 - 01-23-2012 , 11:00 AM






I should add that the first line of code is actually : - on Error
resume Next

I have removed the tag from all of the objects which do not have a
locked and enabled property and it now works fine. I don't understand
why it worked well for so long until today? Another form which had no
amendments to it but has a similar Form Current coding gave the 438
error as well. I'm never happy when things happen that shouldn't!

Reply With Quote
  #3  
Old   
Jan T
 
Posts: n/a

Default Re: Error 438 - 01-23-2012 , 11:21 AM



On 2012-01-23 6:00 PM, BobbyDazzler wrote:
Quote:
I should add that the first line of code is actually : - on Error
resume Next

I have removed the tag from all of the objects which do not have a
locked and enabled property and it now works fine. I don't understand
why it worked well for so long until today? Another form which had no
amendments to it but has a similar Form Current coding gave the 438
error as well. I'm never happy when things happen that shouldn't!

Hi Bobby,

Which of the form objects does ctl refer to when the code bombs out and
what type of object is it ?

Reply With Quote
  #4  
Old   
BobbyDazzler
 
Posts: n/a

Default Re: Error 438 - 01-24-2012 , 03:17 AM



On Jan 23, 5:21*pm, Jan T <access... (AT) yahoo (DOT) com> wrote:
Quote:
On 2012-01-23 6:00 PM, BobbyDazzler wrote:> I should add that the first line of code is actually : - on Error
resume Next

I have removed the tag from all of the objects which do not have a
locked and enabled property and it now works fine. *I don't understand
why it worked well for so long until today? *Another form which had no
amendments to it but has a similar Form Current coding gave the 438
error as well. *I'm never happy when things happen that shouldn't!

Hi Bobby,

Which of the form objects does ctl refer to when the code bombs out and
what type of object is it ?
I don't know Jan ) I had assumed that the original code worked by
ignoring any errors (on Error Resume Next) but now I'm not so sure. I
have fixed it anyway by removing the tag from all objects which do not
have the enabled and locked properties. Thanks for your post.

Reply With Quote
  #5  
Old   
Patrick Finucane
 
Posts: n/a

Default Re: Error 438 - 01-24-2012 , 09:20 AM



On Jan 24, 3:17*am, BobbyDazzler <david.a.mitch... (AT) inbox (DOT) com> wrote:
Quote:
On Jan 23, 5:21*pm, Jan T <access... (AT) yahoo (DOT) com> wrote:

On 2012-01-23 6:00 PM, BobbyDazzler wrote:> I should add that the firstline of code is actually : - on Error
resume Next

I have removed the tag from all of the objects which do not have a
locked and enabled property and it now works fine. *I don't understand
why it worked well for so long until today? *Another form which hadno
amendments to it but has a similar Form Current coding gave the 438
error as well. *I'm never happy when things happen that shouldn't!

Hi Bobby,

Which of the form objects does ctl refer to when the code bombs out and
what type of object is it ?

I don't know Jan ) *I had assumed that the original code worked by
ignoring any errors (on Error Resume Next) but now I'm not so sure. *I
have fixed it anyway by removing the tag from all objects which do not
have the enabled and locked properties. *Thanks for your post.
This is a code example from help.

Dim intI As Integer
Const conTransparent = 0
Const conWhite = 16777215
Dim ctl As Control

For Each ctl in frm.Controls
With ctl
Select Case .ControlType
Case acLabel
If .SpecialEffect = acEffectShadow Then
.SpecialEffect = acEffectNormal
.BorderStyle = conTransparent
Else
.SpecialEffect = acEffectShadow
End If
Case acTextBox
If .SpecialEffect = acEffectNormal Then
.SpecialEffect = acEffectSunken
.BackColor = conWhite
Else
.SpecialEffect = acEffectNormal
.BackColor = frm.Detail.BackColor
End If
End Select
End With
Next ctl

Maybe run your code for specific control types; combox or textboxes
and leave the others alone. Or run some code that Debug.Prints the
control name and control type. When it bombs you have the last
control name that bombed/

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.