OhioSteve, you can't compact and repair the database via vba when the current database is open i'm afraid.
In Access 2000 and later, there is an option to "compact on close" (in the Tools menu). This may be of use to you, otherwise your only other option would be to initiate a second database, close your first and then have the second compact and repair the first!
Hope this helps!
Nick