![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Programmer
Join Date: Sep 2004
Posts: 47
Rep Power: 0
![]() |
VB If Statement Help
I just want to make these statements so that when the if is true, the message box is shown and the form is not closed. If the required fields are blank, then the form should not close, but it is closing after you click the message box. Can anybody help me with this?
Quote:
|
|
|
|
|
|
|
#2 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 852
Rep Power: 4
![]() |
A quick google for "vb onclose event" leads me to think you can just put in
that setting e.Cancel to True cancels the close. |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
one thing I'd suggest, not that you have to is instead of Me.edit_type.Text = "" I would use Me.edit_type.Text = nothing. To me that just seems better, don't know how others would feel. Either way works fine, I just see "Nothing" neater than ""
|
|
|
|
|
|
#4 | ||
|
Programmer
Join Date: Sep 2004
Posts: 47
Rep Power: 0
![]() |
Quote:
Quote:
|
||
|
|
|
|
|
#5 |
|
Newbie
Join Date: Feb 2006
Posts: 12
Rep Power: 0
![]() |
its better write this code into Form.Closing routine
|
|
|
|
|
|
#6 |
|
Programmer
Join Date: Sep 2004
Posts: 47
Rep Power: 0
![]() |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| switch statement | NightShade01 | Java | 5 | Jan 11th, 2007 2:40 AM |
| SQL Select Statement Performance | King | Other Scripting Languages | 6 | Dec 1st, 2006 5:12 PM |
| statement with no effect? | iradic | C | 10 | Oct 23rd, 2006 1:22 PM |
| Why did %S break my if statement? | somehollis | Python | 3 | Jun 22nd, 2006 8:49 PM |
| Trouble with a swith statement | cjaime | C | 10 | Nov 8th, 2005 11:09 AM |