VBA error after update to Office 2007

G

goneill

I've just updated our Office 2003 installaion to 2007. After opening a major
database we run, and saving it into Access2007 format, we get an error when
trying to open a form which has some VBA code attached to it.

The code was written by a consultant and I know very little about VBA so I'm
at a total loss to know what the problem will be.

The process that the code supports is when we double-click on an entry in
one form, it opens another form with all the details for the person we
clicked on in the first form.

The error we get is:
Run-time error '3021'
No current record

When I click on thr debug button the offending line of code is highlighted as:

Forms![Member&Address].Bookmark =
Forms!Member&Address].RecordsetClone.Bookmark

If it helps, the entire subroutine is:

Private Sub MemberNo_DblClick(Cancel As Integer)

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "MEMBER&ADDRESS"

DoCmd.OpenForm stDocName
Forms![Member&Address].RecordsetClone.FindFirst "[MEMBERNO] = " &
Me!MEMBERNO
Forms![Member&Address].Bookmark =
Forms![Member&Address].RecordsetClone.Bookmark
End Sub

Any advice on resloving this would be greatly appreciated!
 
S

Stefan Hoffmann

hi,
The error we get is:
Run-time error '3021'
No current record
Forms![Member&Address].Bookmark =
Forms!Member&Address].RecordsetClone.Bookmark
This is a known problem: the bookmarks collection of your form and a
RecordsetClone may not be identically, thus a mismatch is possible.

Caveat: Don't use such names as MEMBER&ADDRESS for objects.
stDocName = "MEMBER&ADDRESS"
DoCmd.OpenForm stDocName
Forms![Member&Address].RecordsetClone.FindFirst "[MEMBERNO] = " &
Me!MEMBERNO
Forms![Member&Address].Bookmark =
Forms![Member&Address].RecordsetClone.Bookmark
Any advice on resloving this would be greatly appreciated!
Take a look at DoCmd.OpenForm in the OH, there are two parameters worth
a further investigation...



mfG
--> stefan <--
 

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