[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

John Green

12/19/2006 9:23:00 PM

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" <timmulla@discussions.microsoft.com> wrote in message
news:C6CF715C-DE45-434A-BCBA-CE9C087E52E4@microsoft.com...
> 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