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
|
|||
|
|||
Validating two fields
I am trying to create a database in which some of the fields should be
mandatory only under certain conditions. For example: In my "Type of Injury" column, I want the user to be required to enter a value in this column, only if the value in the "Type of Document" column is "Nursing Report". Is this possible? I am only just beginning to teach myself Access, so please bear with me. Thank you. |
#2
|
|||
|
|||
Validating two fields
Put a validation rule on the *table* (not field.)
2nd example under the the Validation Rules for Tables section he http://allenbrowne.com/ValidationRule.html -- 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. "CorpTrainer570" wrote in message ... I am trying to create a database in which some of the fields should be mandatory only under certain conditions. For example: In my "Type of Injury" column, I want the user to be required to enter a value in this column, only if the value in the "Type of Document" column is "Nursing Report". Is this possible? I am only just beginning to teach myself Access, so please bear with me. Thank you. |
#3
|
|||
|
|||
Validating two fields
Thanks for the reply, but is there a way to create a validation rule that
would specifically look for words. for example: in the "Type of Document" column there are three options: "nursing report", "progress note", incident report". Depending on what type of document is selected, certain fields should be required to filled in. If "nursing report" than "type of injury" must be filled in. If "progress note" than "program" must be filled in. If "incident report" than "Description of incident" must be filled in. "Allen Browne" wrote: Put a validation rule on the *table* (not field.) 2nd example under the the Validation Rules for Tables section he http://allenbrowne.com/ValidationRule.html -- 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. "CorpTrainer570" wrote in message ... I am trying to create a database in which some of the fields should be mandatory only under certain conditions. For example: In my "Type of Injury" column, I want the user to be required to enter a value in this column, only if the value in the "Type of Document" column is "Nursing Report". Is this possible? I am only just beginning to teach myself Access, so please bear with me. Thank you. . |
#4
|
|||
|
|||
Validating two fields
On Wed, 17 Feb 2010 08:26:03 -0800, CorpTrainer570
wrote: Thanks for the reply, but is there a way to create a validation rule that would specifically look for words. for example: in the "Type of Document" column there are three options: "nursing report", "progress note", incident report". Depending on what type of document is selected, certain fields should be required to filled in. If "nursing report" than "type of injury" must be filled in. If "progress note" than "program" must be filled in. If "incident report" than "Description of incident" must be filled in. A validation rule would be a really awkward way to do this - the BeforeUpdate event of a Form would be much better and more user friendly. That said, a table validation rule (*NOT* a field validation rule) might be: ([Type Of Document] = "Nursing Report" AND [Type Of Injury] IS NOT NULL) OR ([Type Of Document] = "Progress Note" AND [Program] IS NOT NULL) OR ([Type Of Document] = "Incident Report" AND [Description Of Incident] IS NOT NULL) The validation text would be snarky, because it will be displayed identically regardless of which case occurred - you can customize the message in the VBA code of the BeforeUpdate event, but you can't here. -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|