473,396 Members | 1,758 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,396 software developers and data experts.

Today's Access 97 To 2000 Problem

I’ve been using the code below in Access 97 for years now without any
problems at all. Unfortunately, I now have to convert this db to Access
2000. I tried using the conversion feature and that was a bust. All my
reports, queries and other forms work OK except for this routine. The first
hang-up begins with the “dbOpenSanpshot” – does this exist in 2000?
Also when I type “rstPatient” the “FindFirst” isn’t a method available to me
nor is "NoMatch. What’s the alternative?
Thanks tons,
Becky

Private Sub txtMRN_BeforeUpdate(Cancel As Integer)
'**Looks for duplicate MRN's

Dim rstPatient As Recordset
Dim strMessage As String

strMessage = "THIS MRN IS ALREADY IN THE DATABASE."
strMessage = strMessage & vbCrLf & vbCrLf & "Click OK then click ..."
strMessage = strMessage & vbCrLf & vbCrLf & "Accept to accept the MRN or
Cancel to enter a new MRN."

Set rstPatient = CurrentDb.OpenRecordset("tblShared_Patients",
dbOpenSnapshot)
rstPatient.FindFirst "MRN = '" & txtMRN & "'"

If Not rstPatient.NoMatch Then
MsgBox strMessage, vbInformation
strTargetMRN = txtMRN
With cmdAccept '**allow user to accept MRN
.Enabled = True
.Default = True
End With

cmdCancel.Enabled = True

Cancel = True
SendKeys "{Esc 3}", False
End If
rstPatient.Close
Set rstPatient = Nothing

End Sub

Nov 13 '05 #1
3 1554
In a module window, open the Tools | References. Check the DAO library. Then
qualify all the declarations of objects that are common to both, like
Recordset:

Dim rstPatient As DAO.Recordset

Just as a safety factor, you can move the DAO Reference up above the ADO
reference in the list -- in case you miss qualifying some vital object when
you declare it. Or, if you aren't going to use ADO at all, you can uncheck
the ADO library reference.

What you experienced is because, in Access 2000, only the ADO reference is
checked by default. That is true also in Access 2002, but they "smartened
up" to the fact that most people still use DAO in preference to ADO, for Jet
databases, and now, once again, check DAO by default. But, ADO is checked,
too, so you still need to qualify the references.

One question, though: why are you converting to a version of Access that is,
itself, already out of support? Why not convert to either Access 2002 or,
better, 2003 for which Microsoft support is still available should you get
"backed into a corner" and have to call them?

Larry Linson
Microsoft Access MVP


"Rebecca Smith" <rp*****@pcez.com> wrote in message
news:10*************@corp.supernews.com...
I've been using the code below in Access 97 for years now without any
problems at all. Unfortunately, I now have to convert this db to Access
2000. I tried using the conversion feature and that was a bust. All my
reports, queries and other forms work OK except for this routine. The first hang-up begins with the "dbOpenSanpshot" - does this exist in 2000?
Also when I type "rstPatient" the "FindFirst" isn't a method available to me nor is "NoMatch. What's the alternative?
Thanks tons,
Becky

Private Sub txtMRN_BeforeUpdate(Cancel As Integer)
'**Looks for duplicate MRN's

Dim rstPatient As Recordset
Dim strMessage As String

strMessage = "THIS MRN IS ALREADY IN THE DATABASE."
strMessage = strMessage & vbCrLf & vbCrLf & "Click OK then click ..."
strMessage = strMessage & vbCrLf & vbCrLf & "Accept to accept the MRN or Cancel to enter a new MRN."

Set rstPatient = CurrentDb.OpenRecordset("tblShared_Patients",
dbOpenSnapshot)
rstPatient.FindFirst "MRN = '" & txtMRN & "'"

If Not rstPatient.NoMatch Then
MsgBox strMessage, vbInformation
strTargetMRN = txtMRN
With cmdAccept '**allow user to accept MRN
.Enabled = True
.Default = True
End With

cmdCancel.Enabled = True

Cancel = True
SendKeys "{Esc 3}", False
End If
rstPatient.Close
Set rstPatient = Nothing

End Sub

Nov 13 '05 #2
Larry,
IT WORKS! Thanks a bunch.

The reason for using 2000 is because that's the last update to Access I've
done at home and it's the last update the company I work for has done. Very
few people use Access (where I work) so even to have it on a machine takes
tons of request and pleading.
Becky


"Larry Linson" <bo*****@localhost.not> wrote in message
news:1oo1d.4783$MS1.3399@trnddc02...
In a module window, open the Tools | References. Check the DAO library. Then qualify all the declarations of objects that are common to both, like
Recordset:

Dim rstPatient As DAO.Recordset

Just as a safety factor, you can move the DAO Reference up above the ADO
reference in the list -- in case you miss qualifying some vital object when you declare it. Or, if you aren't going to use ADO at all, you can uncheck
the ADO library reference.

What you experienced is because, in Access 2000, only the ADO reference is
checked by default. That is true also in Access 2002, but they "smartened
up" to the fact that most people still use DAO in preference to ADO, for Jet databases, and now, once again, check DAO by default. But, ADO is checked,
too, so you still need to qualify the references.

One question, though: why are you converting to a version of Access that is, itself, already out of support? Why not convert to either Access 2002 or,
better, 2003 for which Microsoft support is still available should you get
"backed into a corner" and have to call them?

Larry Linson
Microsoft Access MVP

Nov 13 '05 #3
There have been three Service Packs for Access 2000. There have been eight
Service Packs for the Jet 4.0 database engine. I strongly recommend you
obtain and apply all of them. Without the SPs, you may encounter some nasty
bugs that have been fixed.

Larry Linson
Microsoft Access MVP
"Rebecca Smith" <rp*****@pcez.com> wrote in message
news:10*************@corp.supernews.com...
Larry,
IT WORKS! Thanks a bunch.

The reason for using 2000 is because that's the last update to Access I've
done at home and it's the last update the company I work for has done. Very few people use Access (where I work) so even to have it on a machine takes
tons of request and pleading.
Becky


"Larry Linson" <bo*****@localhost.not> wrote in message
news:1oo1d.4783$MS1.3399@trnddc02...
In a module window, open the Tools | References. Check the DAO library.

Then
qualify all the declarations of objects that are common to both, like
Recordset:

Dim rstPatient As DAO.Recordset

Just as a safety factor, you can move the DAO Reference up above the ADO
reference in the list -- in case you miss qualifying some vital object

when
you declare it. Or, if you aren't going to use ADO at all, you can uncheck the ADO library reference.

What you experienced is because, in Access 2000, only the ADO reference is checked by default. That is true also in Access 2002, but they "smartened up" to the fact that most people still use DAO in preference to ADO, for

Jet
databases, and now, once again, check DAO by default. But, ADO is checked, too, so you still need to qualify the references.

One question, though: why are you converting to a version of Access that

is,
itself, already out of support? Why not convert to either Access 2002 or, better, 2003 for which Microsoft support is still available should you get "backed into a corner" and have to call them?

Larry Linson
Microsoft Access MVP


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bon | last post by:
Hello all Would it be possible to migrate the MS Access 2000 to MS SQL Server 2000? My application is using MS Access 2000 as database and as user interface such as forms. Now, I want to...
2
by: Scott | last post by:
Any help would be grateful :-) Problem: When I test my installation of Access 2000 MDE, I get the following error: "Unrecognised Format".. This means that Access 97 cannot read Access 2000. ...
2
by: Wayne Aprato | last post by:
The following problem seems to manifest itself in Access 2000, but I have not experienced it with Access 97. When I make a duplicate of a form before I make design changes to that form that I...
7
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same...
11
by: stu | last post by:
I have several databases that are opened using various versions of Access and VB. Up till recently everything worked fine, then I started getting a variety of lock file error messages, both on my...
47
by: ship | last post by:
Hi We need some advice: We are thinking of upgrading our Access database from Access 2000 to Access 2004. How stable is MS Office 2003? (particularly Access 2003). We are just a small...
9
by: MM | last post by:
And Access 2000 et seq 32 bit? MM
2
by: Cy | last post by:
I have a custom access 2000 database, that has contracts with starting and ending dates. What I'd like to be able to do, is key in a date, say today 9/2/05 and get a list of all "current"...
13
by: Owen Jenkins | last post by:
Following on from an earlier post... I can reliably corrupt a record by doing the following ... Open two separate but identical front ends on one PC each linking to the same back end. Edit a...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.