PDA

View Full Version : Solved: prevent msgbox



Trevor
03-12-2008, 10:12 PM
is there a way to prevent a message box from appearing if a condion on the form is true ?
IE: if me.[Commandbutton].Ennable = false
msgbox = false
I know Msgbox = false or msgbox = cancle
won't work because compiler returns error that the argument on the left must return a value

Trevor
03-12-2008, 10:14 PM
the msgbox will exicute causing [commandbutton].enabled to = false so after it has disabled the commandbutton don't fire msgbox again unless commandbutton.enabled = true

DarkSprout
03-13-2008, 04:26 AM
So somthing like this:

If [Commandbutton].Enabled Then MsgBox "Message Text"

Trevor
03-13-2008, 09:37 AM
Darksrout, that still fires a message box, I'm trying to not fire the messege box if a commandbutton.enabled = false ( but the commandbutton will has been disabled by the messagebox if the messege fired. , I want to not fire the msgbox is command.Enabled = false
thanx for your reply

DarkSprout
03-14-2008, 05:41 AM
Please check out the MDB I've built to show you how - if somthing is NOT Enabled, then a MsgBox won't trigger.

Trevor
03-17-2008, 10:50 AM
That worked darksprout, thanx, although I did use the idea, I ended up
using
Private sub update()
[DLookup]
compare value in from to table value , if different , Disable buttons
then on each button, I used a call to to update and an if statement to stop processing the next command if button was not enabled.