List Box Validation Rule

Screaminxpert

New to Access
Local time
Today, 21:38
Joined
Nov 23, 2008
Messages
18
Hi,

I have a number of forms in an Access 2007 application, the forms have a number of List Box controls which have a default selection of 'Select', this is set by the table.

Some of the list boxes are mandatory and Access is allowing the record to be saved as 'Select' is already selected but I need one of the entries in the list box to be selected.

I know I can use validation rules but I am not quite sure what to put in the expression builder.

So to summerise I need a validation rule that looks at the value of the control and if the value is 'select' then display a warning box and dont allow the record to be saved.

Could someone tell me how I do this?

Thanks
 
Are you using a save button you could do something like this

Private Sub Command37_Click()
If Me.List35 = "select" Then
MsgBox "Please select somthing", vbOKOnly, "Blah Blah"
Me.List35.SetFocus
Else
DoCmd.GoToRecord , , acNewRec
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom