Mandate update

prabhus

Registered User.
Local time
Yesterday, 16:30
Joined
Mar 14, 2012
Messages
67
Hi,

I have three check boxes in my form and i want the user to select any one of the check box, if not, i want to display an error msg?

How to do it?
 
You could use an If statement in your code with a series of AND conditions to check for Null values in the checkboxes.

Depending on when you want the error message to display you can choose an Event to trigger the code to run:

Code:
If Len(checkboxname & vbNullString) = 0 And
Len(checkboxname2 & vbNullString) = 0 And
Len(checkboxname3 & vbNullString) = 0 then
msgbox "Please check one"
end if

This is definitely a rough example and there may be a better way. Such as checking for a boolean condition.
 
Last edited:
Another way would be
Code:
If ckCheckbox1 = False and ckCheckbox2 = False and ckCheckbox3 = False Then
	Msgbox "You must select an option from one of the checkboxes!"
	Cancel = True
End If
 

Users who are viewing this thread

Back
Top Bottom