Strange errors/MS Form 2.0 Library

S

SFAxess

Hello,
I have been developing an ADP in Access 2000. Midway
through development, I upgraded to Access 2002, but kept
the file format Access 2000 since all client machines
have Access 2000. After working on the application for a
month on Access 2002 (in 2000 file format), I just moved
it over to a machine with Access 2000 and am getting
strange errors that never existed before and don't come
up when I run it in Access 2002.
Specifically, I get a (2465) stating that Access can't
find the field 'Forms' referred to in the expression.
This occurs when using record navigation code which I
have used countless times. See code below:

This is based on code from Access 97 Developer's Handbook
by Litwin, Getz, and Gilbert (Sybex)
Copyright 1997. All rights reserved.

Private Sub NavMove(frm As Form, intWhere As Integer)

'
' Move to the correct row in the form's recordset,
' depending on which button was pushed. This code
doesn't
' really need to check for errors, since the buttons
' that would cause errors have been disabled already.
'
Dim rst As ADODB.Recordset
Dim fAtNew As Boolean

Set rst = New ADODB.Recordset

Const adhcErrNoCurrentRow = 3021

If frm.Dirty Then
' Put code here that you would have done in the
' form's AfterUpdate event. You can't use the
AfterUpdate
' event if you've got these buttons in place,
since
' they interfere pretty seriously.
End If

On Error GoTo NavMoveError
' This only works on the CURRENT form.
' You'll need to rethink this if you want
' the buttons on one form, and the record
' movement on another.
If intWhere = acNewRec Then
DoCmd.GoToRecord record:=acNewRec
Else
fAtNew = frm.NewRecord
Set rst = frm.RecordsetClone
rst.Bookmark = frm.Bookmark
Select Case intWhere
Case acFirst
rst.MoveFirst
Case acPrevious
If fAtNew Then
rst.MoveLast
Else
rst.MovePrevious
End If
Case acNext
rst.MoveNext
Case acLast
rst.MoveLast
End Select
frm.Bookmark = rst.Bookmark
End If

NavMoveExit:
Exit Sub

NavMoveError:
If Err.Number = adhcErrNoCurrentRow And frm.NewRecord
Then
Resume Next
Else
MsgBox Err.Description & " (" & Err.Number & ")"
Resume NavMoveExit
End If
Resume NavMoveExit
End Sub

The only thing I can think of is the reference to
the "Microsoft Forms 2.0 Object Library" which is in the
project, but does not normally exist in the Access 2000
reference list.
Does anyone know of a glitch with using Access 2000 file
format while developing in Access 2002?
Thank you so much in advance
 
A

Alick [MSFT]

Hi,

Do you use the UserForm object in your application? If so, please take a
look at the article:

ACC2000: Access 2000 Does Not Support the UserForm Object
http://support.microsoft.com/?id=198646

In addition, could you point out which code line causes the error?


Sincerely,

Alick Ye, MCSD
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.



--------------------
| Content-Class: urn:content-classes:message
| From: "SFAxess" <[email protected]>
| Sender: "SFAxess" <[email protected]>
| X-Tomcat-NG: microsoft.public.access.adp.sqlserver
|
| Hello,
| I have been developing an ADP in Access 2000. Midway
| through development, I upgraded to Access 2002, but kept
| the file format Access 2000 since all client machines
| have Access 2000. After working on the application for a
| month on Access 2002 (in 2000 file format), I just moved
| it over to a machine with Access 2000 and am getting
| strange errors that never existed before and don't come
| up when I run it in Access 2002.
| Specifically, I get a (2465) stating that Access can't
| find the field 'Forms' referred to in the expression.
| This occurs when using record navigation code which I
| have used countless times. See code below:
|
| This is based on code from Access 97 Developer's Handbook
| by Litwin, Getz, and Gilbert (Sybex)
| Copyright 1997. All rights reserved.
|
| Private Sub NavMove(frm As Form, intWhere As Integer)
|
| '
| ' Move to the correct row in the form's recordset,
| ' depending on which button was pushed. This code
| doesn't
| ' really need to check for errors, since the buttons
| ' that would cause errors have been disabled already.
| '
| Dim rst As ADODB.Recordset
| Dim fAtNew As Boolean
|
| Set rst = New ADODB.Recordset
|
| Const adhcErrNoCurrentRow = 3021
|
| If frm.Dirty Then
| ' Put code here that you would have done in the
| ' form's AfterUpdate event. You can't use the
| AfterUpdate
| ' event if you've got these buttons in place,
| since
| ' they interfere pretty seriously.
| End If
|
| On Error GoTo NavMoveError
| ' This only works on the CURRENT form.
| ' You'll need to rethink this if you want
| ' the buttons on one form, and the record
| ' movement on another.
| If intWhere = acNewRec Then
| DoCmd.GoToRecord record:=acNewRec
| Else
| fAtNew = frm.NewRecord
| Set rst = frm.RecordsetClone
| rst.Bookmark = frm.Bookmark
| Select Case intWhere
| Case acFirst
| rst.MoveFirst
| Case acPrevious
| If fAtNew Then
| rst.MoveLast
| Else
| rst.MovePrevious
| End If
| Case acNext
| rst.MoveNext
| Case acLast
| rst.MoveLast
| End Select
| frm.Bookmark = rst.Bookmark
| End If
|
| NavMoveExit:
| Exit Sub
|
| NavMoveError:
| If Err.Number = adhcErrNoCurrentRow And frm.NewRecord
| Then
| Resume Next
| Else
| MsgBox Err.Description & " (" & Err.Number & ")"
| Resume NavMoveExit
| End If
| Resume NavMoveExit
| End Sub
|
| The only thing I can think of is the reference to
| the "Microsoft Forms 2.0 Object Library" which is in the
| project, but does not normally exist in the Access 2000
| reference list.
| Does anyone know of a glitch with using Access 2000 file
| format while developing in Access 2002?
| Thank you so much in advance
|
 

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