Bruce
bbruen at unwired.com.au
Wed Jan 14 05:57:01 CST 2009
On Wednesday 14 January 2009 17:46:15 Bob Gajewski wrote: > Private Function isValidStatus() > Dim Cancel As Integer > If Me.ActiveControl <> "A" And Me.ActiveControl <> "R" And Me.ActiveControl > <> "C" And Me.ActiveControl <> "P" And Me.ActiveControl <> "S" And > Me.ActiveControl <> "N" Then > MsgBox "The valid choices are 'A' (available), 'R' (reserved), 'C' > (chorus/cast), 'P' (pre-sale), 'S' (sold), and 'N' (not available)." > Cancel = True > Me.ActiveControl.Undo > End If > End Function Private Function isValidStatus() as boolean If Me.ActiveControl.value in ("A", "R", "C", "P", "S", "C", "N") Then isValidStatus=true else isValidStatus=false End If End Function Private Sub EventSeatA001_BeforeUpdate(Cancel As Integer) if isValidStatus (Me.ActiveControl.Value) then exit sub else MsgBox "The valid choices are 'A' (available), 'R' (reserved), 'C' (chorus/cast), 'P' (pre-sale), 'S' (sold), and 'N' (not available)." Cancel = True Me.ActiveControl.Undo endif End Sub