RabbieBurns Posted May 20, 2008 Posted May 20, 2008 Set objAccess = CreateObject("Access.Application") objAccess.OpenCurrentDatabase "C:\Inetpub\wwwroot\s4\fpdb\s4.mdb" Set objCommand = objAccess.DoCmd objCommand.OpenReport "Boarding_Summary" objAccess.CloseCurrentDatabase How do I add a message box at the end of that script that just says "printed ok" or something with an OK button. i had this MsgBox("School Reports",65,"Reports sent to the printer...") but get an error about parenthesis. Any clues please? Cheers.
webman Posted May 20, 2008 Posted May 20, 2008 Try any of these: MsgBox "School Reports",65,"Reports sent to the printer..." or Call MsgBox("School Reports",65,"Reports sent to the printer...") 1
RabbieBurns Posted May 20, 2008 Author Posted May 20, 2008 cheers thats the one.. note to self: error about parenthesis? why not remove them and try again before posting.
srochford Posted May 20, 2008 Posted May 20, 2008 cheers thats the one.. note to self: error about parenthesis? why not remove them and try again before posting. Always easy after the event :-) One of the things which really annoyed me when I started using BBC Basic was that it was much more fussy about closing quotes - other BASICs would cope with: Print "Hello World but BBC Basic gave a missing " error - I always wanted to scream at it "well, if you know it's missing, why can't you put it in?" - the same applies here. If it knows that there shouldn't be parentheses then why can't it take them out!
altecsole Posted May 20, 2008 Posted May 20, 2008 cheers thats the one.. note to self: error about parenthesis? why not remove them and try again before posting. MsgBox can use parenthesis. In that case you're calling a function which returns a value to indicate which button was clicked (you may have OK and Cancel for instance). So: buttonClicked = MsgBox("School Reports",65,"Reports sent to the printer...") would work and the value of buttonClicked value would tell you whether OK or Cancel was clicked (1 would be OK, 2 would be Cancel) Using MsgBox without parenthesis calls a Sub, which doesn't return a value.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now