468,168 Members | 1,458 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,168 developers. It's quick & easy.

Error #438 Runtime Error

I'm using Windows XP and MS Access 2002. I am trying to write code in VB which is attached to a text control on a form called "Scripture1". I have another text control on the same form called "Scripture1Means" on which the control visible property is set to "No".

On the "On Got Focus" event of the control, "Scripture1", I have wrtten the following VB:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Scriptures_GotFocus()
  2.      If Me!Scripture1Means.Visible = False Then
  3.        Me!Scripture1Means.Visible = True
  4.      End If
  5. End Sub
In Form View, when I click on the "Scripture1" control, I expect "Scripture1Means" to become visible, but instead I receive the error:
"Runtime Error #438: Object doesn't support this property or method."

In the error window there is a " Help" button which, when pressed, brings this confusing message:

Not all objects support all properties and methods. This error has the following cause and solution:
You specified a method or property that doesn't exist for this Automation object.
See the object's documentation for more information on the object and check the spellings of properties and methods.
You specified a Friend procedure to be called late bound.
The name of a Friend procedure must be known at compile time. It can't appear in a late-bound call.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh)."

In the past I have successfully used the same visible method. However on Google, one of the responses indicated that, using an older version of Access (2002), sometimes Windows makes an update that causes certain controls to have to be resomethingorother. That made sense to me. My version of Access is Microsoft Access 2002 (10.6771.6830) SP3

I will be very thankful to anyone who can shed some light on this behavior.
Sep 28 '07 #1
3 9203
Scott Price
1,384 Expert 1GB
As there is nothing actually wrong with your written code, there must then be something preventing Access from executing the code in the place you have it!

As an interesting exercise place something like this just before the code in question:

Expand|Select|Wrap|Line Numbers
  1. If Me.Dirty = True Then
  2. Dim MeDirt As Integer
  3. MeDirt = 1
  4. Debug.Print MeDirt
  5. Me.Dirty = False
  6. End If 
Then run the code, and check your Immediate window in the VBA editor. If 1 shows up, and the .Visible code executes fine, then you've solved the problem :-)

You can then erase lines 2 through 4 as they are really nec only for debugging.

Regards,
Scott
Sep 28 '07 #2
NeoPa
32,042 Expert Mod 16PB
Have you renamed the first control from "Scriptures" to "Scripture1" by any chance?
The event procedure name doesn't match the name you've given us.
Also, what type are the controls? Not all controls have the same attributes so it's hard to check unless we know which it is.
Sep 29 '07 #3
NeoPa
32,042 Expert Mod 16PB
Also, as you (probably) want the Scripture1Means control to disappear when the focus is lost I would change the code to something similar to :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Scripture1_GotFocus()
  2.   Me!Scripture1Means.Visible = (Not Me!Scripture1Means.Visible)
  3. End Sub
Sep 29 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Rudy Ray Moore | last post: by
reply views Thread by Bill nguyen | last post: by
2 posts views Thread by serviceman via AccessMonster.com | last post: by
3 posts views Thread by moralbarometer | last post: by
reply views Thread by tsivaraman | last post: by
7 posts views Thread by Bob Darlington | last post: by
12 posts views Thread by dale5804 | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.