472,799 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,799 software developers and data experts.

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 9673
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,534 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,534 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

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

Similar topics

2
by: Rudy Ray Moore | last post by:
Whenever I get any error with Vc++7.1/.net/2003, it is followed by huge ammounts of "template assistance" error messaging referencing template code (MTL) that has nothing to do with the error. ...
0
by: Bill nguyen | last post by:
The following function gave an error 438 Object doesn't support this property or method. The same function ran ok on another VB 6. What am i missing? Thanks Bill objConfig =...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
2
by: serviceman via AccessMonster.com | last post by:
Me Again, I just imported a working project from an SQL server based setup to an Access based setup, and now this code is giving me a 'runtime error 438 not defined' message : Private Sub...
3
by: moralbarometer | last post by:
Please i intend to make an XML document from a string using tranformer as shown below. It returns an error which trace is given below as well. please help. public org.w3c.dom.Node getTextXML()...
0
by: tsivaraman | last post by:
I am trying to build php-5.2.1 in RedHat Linux 9. I have installed libxml2-2.6.11,mysql-5.0.33,httpd-2.2.4(apache) successfully.When i do 'make' from the php directory,i get the following...
7
by: Bob Darlington | last post by:
I'm using the following routine to call UpdateDiary() - below: Private Sub Form_BeforeUpdate(Cancel As Integer) On Error GoTo Form_BeforeUpdate_Error Call UpdateDiary(Me!TenantCounter,...
12
by: dale5804 | last post by:
hi, trying to use the code below found on another thread, but am having problems. when using the form, get an error message runtime error 438, object doesnt support this propert or method. it reffers...
0
by: Andy | last post by:
Hello all, I have a user getting an error 438, object doesn't support this prop. or method, when I run code to setup the treeview control. I'm using the MSCOMCTRL.OCX, file version: 6.01.9545....
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.