Reading a textbox

Hello there: I want to know if I can read directly in a textbox, because I want to validate when an specific text is written and to store it in the table. Thanks in advance.

Sure, you have plenty of choices. At table level you can use the OnValidate trigger of the field but it sounds as if that is not what you want. At form level, you can use any of these textbox’s triggers, depending on your specific need: OnInputChange, OnAfterInput, OnValidate, OnAfterValidate. Each of them is well documented in the online help, it’s only a question of selecting the one more adequate to the task.

Just saw your other post in the spanish forum: http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=12348 I was tempted to reply there but my Españolês/Portuñol is not that good… (hope you get that one!) [:D] [:p] You have a Textbox control whose SourceExpr is a Text variable. If the User writes a certain text in the Textbox/Variable, you want to then write it to the database, correct? In case you need to check the value when the User has finished typing (I’m guessing this is what you want), you can use the OnValidate trigger of the Textbox: TextBoxControl - OnValidate() IF TextVariable = 'My Text' THEN BEGIN ... Code ... END; Also, since you need to write to the database, you will not be able to use the OnInputChange and OnAfterInput triggers. Database transactions are not allowed within these triggers.

Nelson, Thanks for your message and answers. If you want try with your “español” [:)] When I have a text variable associated to my text box, it works fine, the trouble is when I have an array associated to it. I don’t know how check the selected value. Regards.

You will just need to add [array_element_number] to the end of the variable name: TextVariable[1], TextVariable[2], etc.

Yes, I know it. But I need to select the ative value, the active value in the text box.

Now I got a little lost… not quite sure I understand.

In this case my text box is working like a combo box, because the source expression is an option variable and I need to take the selected value for the customer.

I guess Table.Field := FORMAT(OptionVariable); should do it.