473,378 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

runtime error 3001

Need a little help please! I am getting runtime error 3001 at oRS.filter = ("RM TYP = '" & cell.Text & "'")

Private Sub CommandButton5_Click()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual

Dim oRS As New ADODB.Recordset
Dim oCN As New ADODB.Connection

With oCN
.Provider = "Microsoft.jet.oledb.4.0"
.CursorLocation = adUseClient
.Open "C:\HC_MDB\HC_DB_ACC.mdb"

End With

With oRS
.LockType = adLockOptimistic
.CursorType = adOpenDynamic
.ActiveConnection = oCN
.Open "Select * from INFO"

Set wsHC = ThisWorkbook.Worksheets("RS")
MsgBox wsHC.Range("E14", wsHC.Range("E" & wsHC.Rows.Count).End(xlUp)).Address
For Each cell In wsHC.Range("E14", wsHC.Range("E" & wsHC.Rows.Count).End(xlUp)).Cells
If cell.Text <> "" Then

oRS.Filter = ("RM TYP = '" & cell.Text & "'")

If oRS.RecordCount <> 0 Then
cell.Offset(0, 2).Value = oRS.Fields("STRUCT HT").Value
cell.Offset(0, 3).Value = oRS.Fields("CEILING HT").Value

End If

oRS.Filter = adFilterNone
End If
Next cell
End With

Application.Calculation = xlCalculationAutomatic
Application.Calculate
Application.ScreenUpdating = True
End Sub

Database: "C:\HC_MDB\HC_DB_ACC.mdb" Table = "info"
RM TYP DESCRIPTION STRUCT HT CEILING HT
E1 INSTRUCTIONAL 14 10
E2 SCIENCE / LAB 14 10
E3 OFFICE 14 9
E4 RECEPTION / WAITING 14 9
E5 STAFF 14 9
E6 CONFERENCE 14 9
E7 FOOD SERVICE 14 9
E8 UTILITY - SHOPS 14 9
E9 SERVICE - STORAGE 14 10
E10 "RESTROOMS ""General""" 14 9
E11 "RESTROOMS ""Private""" 14 8
E12 "COMMONS ""Single Entry""" 14 10
E13 "COMMONS ""Double Entry""" 14 11
E14 "COMMONS ""Zone Division""" 14 10
E15 SHAFT / PLENUM 14 14
E16 STAIR / ELV 14 14
E17 GYM
E18 ATHLETIC ROOMS
E19 ATHLETIC STORAGE
E20 LOCKER ROOMS



Thanks in advance
Aug 1 '06 #1
1 9369

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

Similar topics

5
by: Philippa | last post by:
I'm trying to access data in vba using the openrecordset command. The data in on a SQL Server 2000 database, and I have linked tables to that data. the Table I'm trying to access is one of these...
8
by: Owen Jenkins | last post by:
Hello. For years I've been using the DBEngine.CompactDatabase code to make backups of backend databases. But now I've struck a baffling problem where I get an Invalid Argument error. This...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
6
by: ET | last post by:
Hi, I need help with run time errors. The application is running on Access 2002. It is recordset, loops the records from query, one by one row, in ADO it gives error 80040e21, invalid...
3
by: nkechifesie | last post by:
I have written this code to search my Database before adding a record but at the point (RsVehType.Find StrSql), it gives an error Run-Time error '3001' Arguements are of the wrong type, are out of...
2
by: amindi | last post by:
Hi, In my VB program ,the run time error '3001' occurs when I try to execute the openRecordset statement. Set rsCustomers = db.OpenRecordset("Customers") Here, "db" is the connection....
4
by: wishwish20 | last post by:
I am having a problem with my Database. I am having an issue with being able to update a set of records. What I need is a way to uncheck a checkbox in the underlying table in this query. The # of...
0
by: Imran | last post by:
JOB ID: BE 3001 Please refer to the Job ID in all your communication both in subject line of your email and in the body text. Hi Friends, Good Morning ,...Hope you doing good! Our client needs...
4
by: kwokv616 | last post by:
I have written the following code: Sub UpdateIL4010DB() Dim rst As DAO.Recordset Dim tbl As DAO.TableDef Dim db As DAO.Database Dim fld As DAO.Field Dim indx As...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.