A97 A2000 and A2002

D

Doug

Dear All,

How are you.
I hope your extensive knowledge in Aceess could help me
resolve our Access mysery. Your help is greatly
appreciated.

Regards,
Douglas Li


My Case:
We're in testing phase of upgrading our DB from A97 to
A2002.

All function in DB is working fine in A97.

When the DB(in A97 format) opened in A2002 or 2000(no
problem at startup, is inside one of the features), we
received error "The command or action 'SaveRecord' isn't
available now. 2046". I also tried converting the DB to
A2000 and A2002, the error occurs in both format.
 
W

Wayne Morgan

The first thing to check is your references. In a code window (Alt+F11) go
to Tools|References and make sure that there is a reference checked for DAO.
If there is, verify that it is the most current (v3.6). If not, then uncheck
the one that is checked and scroll down the list and place a check next to
Microsoft DAO 3.6 Object Library.

Next, change your Dim statements to specify DAO. For example, change Dim rst
As Recordset to Dim rst As DAO.Recordset. Do this for all DAO objects
(Database, Querydef, etc). You should be able to use Replace (Ctrl+H) to do
this. In the Find What box put "As Recordset", in the Replace With box put
"As DAO.Recordset" (both without the quotes) and in the Search box choose
Current Project. Do this for each of the DAO objects.

The reason for this is Access 2000 and 2002 use ADO instead of DAO by
default. The References are used in the order that the checked ones are
listed in the references window. You can use the up/down arrows to change
the order, but it is better to explicitly specify them in your Dim
statements, that way if the order gets changed you still won't have a
problem.
 
T

Tony Toews

Doug said:
When the DB(in A97 format) opened in A2002 or 2000(no
problem at startup, is inside one of the features), we
received error "The command or action 'SaveRecord' isn't
available now. 2046". I also tried converting the DB to
A2000 and A2002, the error occurs in both format.

From my Access 2.0 and Access 97 to Access 2000/2002 conversion
issues/problems/bugs page at my website.

Msg: The command or action 'SaveRecord' isn't available now.
DoCmd.DoMenuItem A_FORMBAR, A_FILE, A_SAVERECORD, , A_MENU_VER20
(This is the Access 2.0 format of the below command.)
or
DoCmd.RunCommand acCmdSaveRecord
by themselves no longer work as if the record doesn't need to be
saved. You can add the following line:
if me.dirty then
before the above lines.

Or just replace the above lines, especially the first one as it takes
a second or two to figure out what's all happening, with
If Me.Dirty = True Then _
Me.Dirty = False
This could fit on one line but I choose not to.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
D

Doug

Dear Tony,
I'm so thankful that you came in to help. I got over the
run-time error 2046. However I just discover(after 2046
is fixed) another "run-time error '94": Invalid use of
Null". Below is one of the line of code. Again, I thank
you so very much for your help.

vFeeSum = DSum("Amount", "Receipts", "[Tran Code] = 37
And [Debtor ID] = '" & Me![Debtor ID] & "'")

Warm Regards,
Doug
 
T

Tony Toews

Doug said:
I'm so thankful that you came in to help. I got over the
run-time error 2046. However I just discover(after 2046
is fixed) another "run-time error '94": Invalid use of
Null". Below is one of the line of code. Again, I thank
you so very much for your help.

vFeeSum = DSum("Amount", "Receipts", "[Tran Code] = 37
And [Debtor ID] = '" & Me![Debtor ID] & "'")

I've never used DSum so I have no idea. However presumably the
problem is that the value of me![Debtor ID] is null. As to why it is
null is another problem. You'll need to step through your code and
figure things out.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
D

Doug

Dear Tony,
I was able to bypass the error "94" by changing the error
handling in VB. Thanks again for your help.


Warm Regards,
Doug


-----Original Message-----
Doug said:
I'm so thankful that you came in to help. I got over the
run-time error 2046. However I just discover(after 2046
is fixed) another "run-time error '94": Invalid use of
Null". Below is one of the line of code. Again, I thank
you so very much for your help.

vFeeSum = DSum("Amount", "Receipts", "[Tran Code] = 37
And [Debtor ID] = '" & Me![Debtor ID] & "'")

I've never used DSum so I have no idea. However presumably the
problem is that the value of me![Debtor ID] is null. As to why it is
null is another problem. You'll need to step through your code and
figure things out.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
.
 

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