Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If statements

The following code will display the message when the calendar is clicked if
any of the textboxes are empty.

Change the Or to And if the message is to display only when all the
textboxes are empty.

Private Sub Calendar1_Click()
If TextBox1.Value = "" Or TextBox6.Value = "" Or TextBox7.Value = "" Then
MsgBox "Wrong, wrong, wrong!"
End If
End Sub

The same code can be used in the click event of the command button.

John Green
Sydney

"timmulla" wrote in message
...
Can anyone help me with IF statements in VB code. I have a form with the
following objects:

Calendar1 - CalendarControl
Commandbutton1
TextBox1
TextBox6
TextBox7

I'm trying to have an error message (or userform) pop up if a user clicks
either the calendar1 or the commandbutton1 without having manual inputs in
TextBox1, TextBox6, or TextBox7.

Can anyone help me with this?

Thanks
--

Regards,

timmulla



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
if and and statements Combining multiple if & and statements Charts and Charting in Excel 2 April 20th 06 01:29 PM
If... Then statements BaldySlaphead Excel Discussion (Misc queries) 1 March 21st 06 11:53 AM
using if statements LAybar Excel Worksheet Functions 4 March 20th 06 02:55 PM
operator statements, shorting when reusing one of the statements? KR Excel Programming 1 August 4th 05 06:20 PM


All times are GMT +1. The time now is 05:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"