Runtime error 438

Mike Hughes

Registered User.
Local time
Today, 15:00
Joined
Mar 23, 2002
Messages
493
When I run this event procedure :


Private Sub Command1_Click()
'Search for Specific Name in the "Name" field
On Error GoTo Err_Command1_Click
Dim strLen, i As Integer
Dim strTempName, strSearchName As String

strLen = Len(strSearchName)

DoCmd.GoToControl "Name"
strSearchName = InputBox("Enter Member Name.", "Look Up Name")
DoCmd.FindRecord strSearchName, acAnywhere, , acSearchAll, , acCurrent, True


Exit_Command1_Click:
Exit Sub

Err_Command1_Click:
MsgBox Err.Decription
Resume Exit_Command1_Click
'MsgBox "Cancelled"
'Resume Exit_Command102_Click

End Sub

If I don't enter a name and click ok or cancel I get a runtime error # 438. Object doesn't support this property of method.
When I debug it highlights this line
MsgBox Err.Decription

Can someone tell me what is wrong?

Thanks :confused:
 
You code is dying because you are not testing for Nulls. I would use a combo box and set the "Limit to List" property to True. That will prevent a user from typing a 'Member Name' that does not exist. Then put your code in the AfterUpdate event of your combo box. User's will still be able to key the member name once they select the combo box. The combo box will start to fill the member names with the names that match what the user is keying if it exists.

I noticed that you Dim'd a couple of strings with actually declaring them as string. Should be...
Dim strLen As String
Dim i As Integer
Dim strTempName As String
Dim strSearchName As String

Your error trapping would be more complete it if was somthing simular to this...
Code:
Private Sub cbSearchMember_AfterUpdate()
On Error GoTo cbSearchMember_AfterUpdate_Err

'Your code here

cbSearchMember_AfterUpdate_Exit:
    Exit Sub

cbSearchMember_AfterUpdate_Err:
    Msgbox Err.Number & " - " &  Err.Description
    Resume cbSearchMember_AfterUpdate_Exit

End Sub
Also, I suggest that you use a simple naming convention with your objects.

HTH
 
438 Error Assigning Value to Option Group

Using Access XP
RunTimeError 438: "Object doesn't support this property or method."

I thought I'd just add to this thread. Looks like the only one for this RunTime error.

Mine is for the following assignment in command in VBA:

Me.Controls("<name of option group>").OptionValue = 2

I obtained the syntax from the XP Help system exampe. (search on OptionValue).

All suggestions and advice are appreciated. Thank you!
 
Sorrells,

So, how are you doing with XP? I've seen a lot of posts from
you lately.

In A2000, I put Me.MyGroup = 3

and it works fine. OptionValue is not on the dropdown list.

Wayne
 
WayneRyan,

XP is giving me a real run for my money! I am getting familiar and perhaps inching up on the learning curve. I remain very upset with the Help Subsystem. I am just becoming aware that there is one in the Access side of the environment and another on the Visual Basic side. Perhaps this is where some of the confusion is coming in. I really miss the A97 environment!

Your command syntax is just fine. I could not find it in either Help. However, the VB Help returns a discussion of the 'AfterUpdate Event' when I search on OptionGroup. It seems to go on like this for many topics.

I am making progress and appreciate your question. I surely do thank all who participate in this forum as it has been a lifesaver for me in many situations!
 

Users who are viewing this thread

Back
Top Bottom