If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Greater Than Message Box
I would like a message box to appear when the value entered in textbox
“TimeA” is greater than the valued entered in textbox “TimeB”. The message box should have two buttons “OK” and “CANCEL”. Thanks -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200802/1 |
#2
|
|||
|
|||
Greater Than Message Box
On Wed, 27 Feb 2008 22:39:13 GMT, "pushrodengine via AccessMonster.com"
u36225@uwe wrote: I would like a message box to appear when the value entered in textbox TimeA is greater than the valued entered in textbox TimeB. The message box should have two buttons OK and CANCEL. Thanks I'd suggest using the Form's BeforeUpdate event (so it won't matter which textbox the user fills first): Private Sub Form_BeforeUpdate(Cancel as Integer) Dim iAns As Integer If IsNull(Me!TimeA) Then MsgBox "Please fill in TimeA", vbOKOnly Cancel = True Exit Sub End If If IsNull(Me!TimeB) Then MsgBox "Please fill in TimeB", vbOKOnly Cancel = True Exit Sub End If If Me!TimeA Me!TimeB Then iAns = MsgBox("Do you really want TimeA greater than TimeB?", vbOKCancel) Cancel = (iAns = vbCancel) End If End Sub -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|