Subject: Validating textbox in field level
Posted By: Paula222 Post Date: 2/9/2006 5:17:17 AM
I created text box in Form Details view by wizard - and althought in design view it's only one text-box with Name , when i open the form i have about 10 text-boxes (this is from table of course) . Now i want to control the input in each text box and i want for example that this will containt one of the following chars : "6" , "j" , "g" , "a"  , "" .
How can i implement this ?


Reply By: mmcdonal Reply Date: 2/10/2006 7:30:53 AM
You can do this in Table Design by creating a validation rule.

You can also do this using one of the events on the text box (maybe Before Insert and use code to check the text entered.

Did you want to have 10 text boxes or just one? If the form is bound to a table, then just open the fields dialog box for the form and drag and drop the field to the form. You may also have the form in continuous form view.



mmcdonal
Reply By: mmcdonal Reply Date: 2/10/2006 7:32:03 AM
Sorry, you would use the InString function to check for your text. You check the string and if Instr = 0 then the value was not inserted.

mmcdonal
Reply By: Paula222 Reply Date: 2/10/2006 11:05:57 AM
Hi ,
What i meant is that i each text box is bounded to column in a table , and when i open the form (not in design view) there are many text boxes (empty) . Now what i want is to control each this text box .

Reply By: mmcdonal Reply Date: 2/10/2006 11:39:54 AM
Start by using table level validation or input masks and see if this works for you.

mmcdonal
Reply By: SerranoG Reply Date: 2/15/2006 10:57:21 AM
Create a table that holds only the allowed choices for that textbox.

Then in the form's design view, change that textbox into a combobox.  Make its rowsource equal to the contents of that table you just created.  Set the combobox's "Limit to List" property as YES.

When you open the form in Form View and the user goes to that combobox, the user can only choose from items you specified in the dropdown list.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division

Go to topic 40086

Return to index page 369
Return to index page 368
Return to index page 367
Return to index page 366
Return to index page 365
Return to index page 364
Return to index page 363
Return to index page 362
Return to index page 361
Return to index page 360