Thanks Mile-O-Phile
The latter one has helped me a bit and I have managed to partially solve my problem without any coding. I have used the a macro to record the date and then the send keys function to choose compact from the menus i.e. "%tdc" which means I can automatically compact the database I'm working in. The only problem I've got though is that if the user clicks on Compact database on the menu themselves, it won't register the date in my table. I can't take that off the menu so they can't click on it otherwise my send keys function won't work. Is there any way to maybe hide menu items but still have them available to my send keys function?
Stephen