Table Validation is not working

Cindy

Registered User.
Local time
Today, 12:28
Joined
Jul 3, 2014
Messages
160
aargh! help me please. I am creating a database with Access 2010. The table in question has as many as 20 columns but the List box selection in Col1 should allow ONLY certain columns to be updated and the other columns disabled for the same row. I am going round and round and have managed to confuse meself even further. Anyone please tell me what I'm doing wrong? Your help is greatly needed and appreciated.

List Box in [Condition] has values Pregnant, On Route delivery, Post Partum Hemorrhage, Preterm Labour. For example selecting Pregnant in this column should allow me to update 11 columns and if I select Post Natal Hemorrhage in the next row, I should not be able to update any of those eleven columns. I want to be able to update another set of columns. This is an example of what I put in the table validation rule but it is not working as I want it to. I changed the col names and am using only five columns here for convenience:

IIf(([Condition] = "On-Route Delivery" Or [Condition] = "Post Partum Hemorrhage") And
(IsNull([columnF]) Or IsNull([columnG]) Or IsNull([columnH]) Or IsNull([columnI]) Or IsNull([columnJ]))) OR
(([Condition]="Pregnant" Or [Condition]="Pre-Term Labour") And (Not IsNull([columnF]) Or Not IsNull([columnG]) Or Not IsNull([columnH])
Or Not IsNull([columnI]) Or Not IsNull([columnJ]))),True,False)

 
Hi, thank you for responding. Prior to now, I only did simple queries. I am now wading into the programming pool so I apologise for my ignorance. Although it is still in the early stages of DB creation, I want to put this control directly in the table i.e. when I select a value from my list in [Condition], I want the table to accept updates to certain columns of that same row and not the others. Your advise is greatly appreciated.
 
There is an updatable/editable property to each control. You'll probably find it in the data tab.
 
I haven't gotten to creating the Forms yet so I guess I'll just trudge on until then. Many thanks for your advise.
 
Hey BlueIshDan, thanks for your input. Are you referring to controls on the Form or the table?
 
The Form.


This here is just to make up for the 10 character limit that annoys the crud out of me.
 
Okay. I'll look it up when I get to the Forms.
Many thanks!
 
Cindy, what Uncle Gizmo and BlueIshDan are saying is that you can do this type of validation far simpler on a form. You will have far better control.
 
Yeah, you don't need to be doing this kind of validation on the level of a table, and I don't think you actually can anyway.
 
Roger that. I figured as much:) I'm very glad I discovered this group.

Many thanks SparklyPrincess6969 and vbaInet
 

Users who are viewing this thread

Back
Top Bottom