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
|
|||
|
|||
Control Validation
What is the best expression to use in the Validate property for a control to
test that some text (of unconstrained length) has been entered. |
#2
|
|||
|
|||
Control Validation
Open the table in design view, and set the field's Required property to Yes.
If you prefer to use the Validation Rule of the field in the table: Is Not Null If you want to do it in a form, use the BeforeUpdate event of the form to test it the control IsNull(). You cannot merely use the Validation Rule of the control, since that is not triggered if nothing is entered. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Confused Slug" wrote in message ... What is the best expression to use in the Validate property for a control to test that some text (of unconstrained length) has been entered. |
#3
|
|||
|
|||
Control Validation
I am currently using the the following code in the beforeupdate event,
Private Sub DESCRIPTION_22_BeforeUpdate(Cancel As Integer) If IsNull(DESCRIPTION_22) = True Then MsgBox "Enter text" Cancel = True End If End Sub I have found that the validation does not take place until the field has had a value in it. When a new record is created i find that you can tab out of the control without entering any text. Only when text has been added and deleted does the validation event occur. "Allen Browne" wrote: Open the table in design view, and set the field's Required property to Yes. If you prefer to use the Validation Rule of the field in the table: Is Not Null If you want to do it in a form, use the BeforeUpdate event of the form to test it the control IsNull(). You cannot merely use the Validation Rule of the control, since that is not triggered if nothing is entered. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Confused Slug" wrote in message ... What is the best expression to use in the Validate property for a control to test that some text (of unconstrained length) has been entered. |
#4
|
|||
|
|||
Control Validation
Yep: exactly what we said.
The events of the control won't work. Use the *form's* BeforeUpdate event (not the control's event), or the field properties in the table. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Confused Slug" wrote in message ... I am currently using the the following code in the beforeupdate event, Private Sub DESCRIPTION_22_BeforeUpdate(Cancel As Integer) If IsNull(DESCRIPTION_22) = True Then MsgBox "Enter text" Cancel = True End If End Sub I have found that the validation does not take place until the field has had a value in it. When a new record is created i find that you can tab out of the control without entering any text. Only when text has been added and deleted does the validation event occur. "Allen Browne" wrote: Open the table in design view, and set the field's Required property to Yes. If you prefer to use the Validation Rule of the field in the table: Is Not Null If you want to do it in a form, use the BeforeUpdate event of the form to test it the control IsNull(). You cannot merely use the Validation Rule of the control, since that is not triggered if nothing is entered. "Confused Slug" wrote in message ... What is the best expression to use in the Validate property for a control to test that some text (of unconstrained length) has been entered. |
Thread Tools | |
Display Modes | |
|
|