Connecting Tech Pros Worldwide Help | Site Map

where I made mistake on compact the current database?

Paul T. Rong
Guest
 
Posts: n/a
#1: Nov 13 '05
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?




Paul T. Rong
Guest
 
Posts: n/a
#2: Nov 13 '05

re: where I made mistake on compact the current database?


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>
??????:40c8b8f7$0$26618$afc38c87@auth.uk.news.easy net.net...[color=blue]
> Paul T. Rong wrote:
>[color=green]
> > Dear all,
> >
> > My aim is to compact and repair current database, I got the following[/color][/color]
code[color=blue][color=green]
> > 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[/color][/color]
no. 5.[color=blue][color=green]
> > something like "invalid process ...."
> >
> > where I made mistake?
> >
> >
> >
> >[/color]
> 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[/color]


Trevor Best
Guest
 
Posts: n/a
#3: Nov 13 '05

re: where I made mistake on compact the current database?


Paul T. Rong wrote:[color=blue]
> thanks a lot, but I get confused....it does not work on my access 2000. Very
> strange thing.
>
> anybody got an idea?
>[/color]

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
Paul T. Rong
Guest
 
Posts: n/a
#4: Nov 13 '05

re: where I made mistake on compact the current database?


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>
??????:40ca037a$0$27996$afc38c87@auth.uk.news.easy net.net...[color=blue]
> Paul T. Rong wrote:[color=green]
> > thanks a lot, but I get confused....it does not work on my access 2000.[/color][/color]
Very[color=blue][color=green]
> > strange thing.
> >
> > anybody got an idea?
> >[/color]
>
> 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[/color]


Closed Thread


Similar Microsoft Access / VBA bytes