Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validation in grids
Message
From
02/09/2003 03:11:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00825044
Message ID:
00825176
Views:
16
>Want to put some validation in my grid:
>
>1) Want my column to be either S or F. Don't want to use a combo box cause this means click on the dropdown porton of it.
>
>So I put some code in the valid event of my text box in the column, to check if this.value$"FS ", if its not I want a suitable message to appear, seems to get stuck when the validation fails?
>
>Can't remember how to cause a message to be returned
>
>Thanks in advance

Robin,
FWIW never use valid in a grid (suggestion - language supports it though). When you need a validation LostFocus is generally a much better place. ie:
*Lostfocus
if !this.value $ 'FS'
  nodefault
  messagebox('F or S only.')
  this.Setfocus()
endif
However for just allowing F,S to be entered you don't need any code. Set :
Format : M
Inputmask : F,S && ( or ,F,S if you allow empty value)

Values could be typed either by F,S or using space (space cyles between available values).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform