If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Validation in text
I am using a text field named "payperiod" in a subform . I want to restrict
data being entered between 1 and 26. I have tried text validation rule 1 or 27 but I am still able to enter any number in that field. Any sugestions to correct the problem are appreciated. |
#2
|
|||
|
|||
Validation in text
Hi Nick,
Just for clarity: tables have fields, forms have controls; controls can be bound to fields. So it sounds like you have a text box (control) on a form. If you entered 1 Or 27 in the validation rule property of the text box, you can enter any number that is less than 27 (like -100). If you want to limit the entries to 1 to 26 inclusive, use 0 and 27 in the validation rule property. HTH -- Steve S -------------------------------- "Veni, Vidi, Velcro" (I came; I saw; I stuck around.) "Nick" wrote: I am using a text field named "payperiod" in a subform . I want to restrict data being entered between 1 and 26. I have tried text validation rule 1 or 27 but I am still able to enter any number in that field. Any sugestions to correct the problem are appreciated. |
#3
|
|||
|
|||
Validation in text
In the Before Update event of the control (not a field) payperiod:
Private Sub payperiod_BeforeUpdate(Cancel As Integer) If Me.payperiod 1 Or Me.payperiod 26 Then MsgBox "Pay Period must be between 1 and 26" Cancel = True End If -- Dave Hargis, Microsoft Access MVP "Nick" wrote: I am using a text field named "payperiod" in a subform . I want to restrict data being entered between 1 and 26. I have tried text validation rule 1 or 27 but I am still able to enter any number in that field. Any sugestions to correct the problem are appreciated. |
#4
|
|||
|
|||
Validation in text
Thanks, works great.
"Steve Sanford" wrote: Hi Nick, Just for clarity: tables have fields, forms have controls; controls can be bound to fields. So it sounds like you have a text box (control) on a form. If you entered 1 Or 27 in the validation rule property of the text box, you can enter any number that is less than 27 (like -100). If you want to limit the entries to 1 to 26 inclusive, use 0 and 27 in the validation rule property. HTH -- Steve S -------------------------------- "Veni, Vidi, Velcro" (I came; I saw; I stuck around.) "Nick" wrote: I am using a text field named "payperiod" in a subform . I want to restrict data being entered between 1 and 26. I have tried text validation rule 1 or 27 but I am still able to enter any number in that field. Any sugestions to correct the problem are appreciated. |
Thread Tools | |
Display Modes | |
|
|