By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,663 Members | 1,813 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,663 IT Pros & Developers. It's quick & easy.

where I made mistake on compact the current database?

P: n/a
Dear all,

My aim is to compact and repair current database, I got the following code
from http://www.mvps.org/access/general/gen0041.htm

Option Compare Database

' ***** Code Start *****
Public Sub CompactDB()

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction

End Sub
' ***** Code End *****

'-----------------------------------------------------

'then I made a form, and a command button "command1"

Private Sub command1_Click()
Call CompactDB
End Sub

'-------------------------------
but when I click on the command button, there occured a error message no. 5.
something like "invalid process ...."

where I made mistake?


Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
thanks a lot, but I get confused....it does not work on my access 2000. Very
strange thing.

anybody got an idea?

Paul

"Trevor Best" <nospam@localhost>
??????:40***********************@auth.uk.news.easy net.net...
Paul T. Rong wrote:
Dear all,

My aim is to compact and repair current database, I got the following code from http://www.mvps.org/access/general/gen0041.htm

Option Compare Database

' ***** Code Start *****
Public Sub CompactDB()

CommandBars("Menu Bar"). _
Controls("Tools"). _
Controls("Database utilities"). _
Controls("Compact and repair database..."). _
accDoDefaultAction

End Sub
' ***** Code End *****

'-----------------------------------------------------

'then I made a form, and a command button "command1"

Private Sub command1_Click()
Call CompactDB
End Sub

'-------------------------------
but when I click on the command button, there occured a error message no. 5. something like "invalid process ...."

where I made mistake?

From the code you posted, nowhere, it works fine (I just copied and
pasted it and tried). Your problem must lie elsewhere or there's
something else about your environment that's influencing it.

--
Error reading sig - A)bort R)etry I)nfluence with large hammer

Nov 13 '05 #2

P: n/a
Paul T. Rong wrote:
thanks a lot, but I get confused....it does not work on my access 2000. Very
strange thing.

anybody got an idea?


I should confirm that I tried it on Access 2002, do you have all the
latest service packs installed?

--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Nov 13 '05 #3

P: n/a
I did install the latest office 2000 service pack 3.
Thanks for confirmation, maybe I should upgrade to Access 2002.

Paul

"Trevor Best" <nospam@localhost>
??????:40***********************@auth.uk.news.easy net.net...
Paul T. Rong wrote:
thanks a lot, but I get confused....it does not work on my access 2000. Very strange thing.

anybody got an idea?


I should confirm that I tried it on Access 2002, do you have all the
latest service packs installed?

--
Error reading sig - A)bort R)etry I)nfluence with large hammer

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.