|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
validation rule
I need to create a validation rule that that hasto be different from the other field of the table.
Table Brother Field1: ID Field2: ID_BRO ID has to be different from ID_BRO i tried in ID validation rule "<>[ID_BRO]" , does not work. Is there a way Please help |
|
#2
|
|||
|
|||
|
You can use a simple code in the Before Update event for the ID field
If ID = ID_BRO Then MsgBox "ID Must Not Be The Same As ID_BRO" DoCmd.CancelEvent SendKeys "{ESC}" End If This will cancel the event and place the curser in the ID field for a new or different entry before proceeding with the data entry. If you use the <>[ID_BRO] without the quotes that will work also in the Validation Rule. You can type what message to display in the Validation Text in quotes..ex "ID must not be the same as ID_BRO" lwells |
|
#3
|
|||
|
|||
|
No problems with the first one thank u very much.
<>[ID_BRO] without "" does not work in validation rule the error that appears is " Invalid SQL Syntax - cannot use multiple columns in a column-level CHECK constraint" Strange? |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > validation rule |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|