Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object doesn't support this property or method

Status
Not open for further replies.
Sep 21, 2001
28
US
I received this error message when I run a function on my computer. It was working fine before, until I tried to run the database with a different machine. I'm not sure am I missing any dll files or ActiveX controls. Did anyone experience a similar problem? If so how do you fix it.

Oh, I also checked for the Knowledge Base at microsoft's websites, but it solution (Q174538) does not apply to my problem.
 
go into a module (open one or create a new one) and check the tools=>references menu command.... this will show you the references that you have set up with this database, and let you know if there are any missing...


GComyn
 
I checked the list already, but how would I know what is missing. And if something is missing, where do I download the missing components. There are a lot of components included on the list, but only 3 of the components are checked: Visual Basic for Application, Microsoft Access 8.0 Object Library, and Microsoft DAO 3.5 Object Library.

I'm currently using Access 97. Thanks for the prompt reply.
 
Well.. if anything was missing, there would be a 'MISSING: ' in front of the reference.

What function are you trying to run?

GComyn
 
I checked for all the components and nothing appear to be missing. I tried uninstall and reinstall couple of times w/ eraser97, and still it gave me the same problems. I'm sure to install all the necessary SR1, SR2a, and SR2b.

Here is the sample code that causes problems. I doubt it's the coding because it works at home just fine w/ the same exact settings. For some reason, when I try to run it at work, it gave me that error message.

Private Sub cmdRefreshData_Click()
Dim strSQL As String

On Error GoTo Handle_Error
Compare_Names
Me.Refresh

Exit_Handle_Error:
Exit Sub

Handle_Error:
MsgBox Err.Description
Resume Exit_Handle_Error

End Sub

Function Compare_Names()
Dim dbs As Database
Dim EmployeeName As Recordset
Dim TmpQueryResult As Recordset
Dim TLName, TFName, TMI As String
Dim start_time

Set dbs = CurrentDb
Set EmployeeName = dbs.OpenRecordset("EmployeeName")
Set TmpQueryResult = dbs.OpenRecordset("TmpQueryResult")

ProgBar.Min = 0
ProgBar.Max = TmpQueryResult.RecordCount
ProgBar.Value = 0
'start_time = Time

Do While Not TmpQueryResult.EOF
'TmpQueryResult.MoveFirst



With TmpQueryResult
TLName = TmpQueryResult!EmpNameL
TFName = TmpQueryResult!EmpNameFI
TMI = TmpQueryResult!EmpNameMI
EmployeeName.MoveFirst
ProgBar.Value = ProgBar.Value + 1
Do While Not EmployeeName.EOF
' EmployeeName.MoveFirst
With EmployeeName
If Trim(Left(EmployeeName!LastName, 9) = Trim(Left(TLName, 9)) And _
Left(EmployeeName!FirstName, 1) = Left(TFName, 1) And _
Left(EmployeeName!MI, 1) = Left(TMI, 1)) Then
TmpQueryResult.Edit
TmpQueryResult!EmpNameL = UCase(EmployeeName!LastName)
TmpQueryResult!EmpNameFI = UCase(EmployeeName!FirstName)
TmpQueryResult!EmpNameMI = EmployeeName!MI
TmpQueryResult.Update
Exit Do
Else
EmployeeName.MoveNext
End If
End With
Loop
End With
TmpQueryResult.MoveNext
Loop

TmpQueryResult.Close
EmployeeName.Close
Set dbs = Nothing

End Function
 
Well... I can't see where it would crash... what line is it stopping on? Have you stepped through the function to see what the variables are while it is working?

You can do this by putting a breakpoint where you want it to stop, then hitting 'F8' to step through the lines. if you put the cursor over a variable (or field name...) it will tell you what that variable has as a value.

GComyn
 
I don't have Visual Studio installed, so I can't really utilize the break and step through utilities. I wonder would it fix it if I install Visual Studio on my computer. I figure there might be some additional components added when Visual Basic is installed.

Check back with you later.
 
You don't need visual Studio to step through an Access Database VBA, even for Access2K..... if you look under the Debug menu command in the VBA Editor, you will see the breakpoint information... as well as stepthrough.....

I do not have Visual Studio, and I"m using Access97, and I step throught my code all the time...

GComyn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top