Limit input into a bound Textbox


Author
Message
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
The following is the definition of the field in the database: [Event] [char](2) NOT NULL, and the following is what I have as the default in the database: DEFAULT ('') FOR [Event].



How do I limit the user from entering only CC in the bound text box on a form or leaving it blank? If the user enters anything else I want to set it back to '' and return to the input form.



I have tried using the CheckRulesonCurrentRow like the following but it does not seem to work:



if me.sportbo.event <> "CC" and me.sportbo.event <> "" THEN

return False

endif



I have also tried me.sportbo.event <> " " AND me.sportbo.event <> " " (one space and two spaces between the "").

I also tried me.sportbo.event <> string.empty



It should be easy I think. TIA







Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Terry Bottorff (11/17/2009)
How do I limit the user from entering only CC in the bound text box on a form or leaving it blank? If the user enters anything else I want to set it back to '' and return to the input form.


Hi Terry,



There are many ways to do this, but if they can only enter some specific data, then use a ComboBox and either preset the values or use a lookup table.

Edhy Rijo

Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
Makes sense thank you.
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Also if you don't mind using an Integer field instead of Character, you can create a Public Enum with the values allowed and bind the combobox to that Enum and that will take of the problem. I do that all the time for very short lookup options.

Edhy Rijo

Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
Alright I'll think about that. Thanks.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search