Run Time Type Mismatch error

P

Paul S Panoff

I am getting a run time error of object type mismatch when using the
following code in a module.
The "MapExt" query is an existing query in the database that runs fine
outside of the module. I need to update groups of records with a value
that resets at the next group.

Public Sub UpdatePersonValues()
' use to update the map-Prsn field with unique sequential
values that
' represent the color codes for the routes within each cycle

Dim rsQ As Recordset
Dim svOfc As String, svCyc As Integer, svRte As String
Dim colorCnt As Integer

Set rsQ = CurrentDb.OpenRecordset("MapExt") <-- run time
error here

'begin loop to go thru all records from query

With rsQ
svOfc = .Fields(0) 'save initial office value
svCyc = .Fields(1) 'save init cycle
 
A

Allen Browne

References issue:
http://allenbrowne.com/ser-38.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.



I am getting a run time error of object type mismatch when using the
following code in a module.
The "MapExt" query is an existing query in the database that runs fine
outside of the module. I need to update groups of records with a value
that resets at the next group.
Public Sub UpdatePersonValues()
' use to update the map-Prsn field with unique sequential values that
' represent the color codes for the routes within each cycle
Dim rsQ As Recordset
Dim svOfc As String, svCyc As Integer, svRte As String
Dim colorCnt As Integer
Set rsQ = CurrentDb.OpenRecordset("MapExt") <-- run time error here

'begin loop to go thru all records from query
With rsQ
svOfc = .Fields(0) 'save initial office value
svCyc = .Fields(1) 'save init cycle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top