Results 1 to 6 of 6
  1. #1
    Desstro's Avatar
    Desstro is offline Competent Performer
    Windows XP Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    185

    Question Help with validation rule

    =IF(B4>1,(IF(AE4="N",0,(IF(AQ4>0,0,1)))),)

    This is the formula I am using in a ridiculously huge excel sheet that I am trying to convert into a database.

    I am struggling with how to type this into the validation rule in the access table.

    Can anyone type out what it is I need to type as the validation rule?



    I would greatly appreciate it.

  2. #2
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    I personally stay away from entering any type of validation criteria into the table design itself but instead prefer to code this in on the form. (Regardless, you wouldn't be able to put criteria such as you noted as validation criteria in excel.)

    The excel equation "=IF(B4>1,(IF(AE4="N",0,(IF(AQ4>0,0,1)))),)" will most likely need to be coded in vba since it looks like it's based on previous field values in the table.

    With MSAccess, you perform this by either using the dlookup command or opening a recordset and looping through it, queries, or even a combination of any of these. Since an MSAccess table isn't like an excel table where you identify rows/columns using references like B4, AE4, etc..., you'll need to figure out what fields/values you want to look up in the table.

    This will unlikely work though if you try to equate this into the table itself as validation criteria. It will need to be coded in vba or using the dlookup command or via a query or multiple queries.

  3. #3
    Desstro's Avatar
    Desstro is offline Competent Performer
    Windows XP Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    185
    Thanks, thats great info. I will most likely use queries to accomplish what I am trying to do but because I am still learning and am stubborn and it is going to kill me to not figure it out, I would still like to know what the validation rule would look like given

    B4=field"Alpha" AE4=field"bravo" and AE4=field"Charlie" and lets say the field i am setting the rule for if field"delta"

    Could you please show me?

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by Desstro View Post

    Could you please show me?
    why not have a higher level programmer at BP show you? or would that make you look bad? (he he, just kidding, bud!)

  5. #5
    Desstro's Avatar
    Desstro is offline Competent Performer
    Windows XP Access 2010 (version 14.0)
    Join Date
    May 2010
    Posts
    185
    a higher level programmer at BP
    Whats funny about that is the quote itself, like that exists!

    Bwaaaahaaaahahahaha!

    I've said to much...I'm sure the Queen is watching me now.

    Nah it wouldn't make me look bad but if I could find the answer it certainly would make me look good.
    Actually I don't even plan on doing it that way its more for personal knowledge now.
    But it seems to me from all I have tried, that I cant set a validation rule that contains multiple fields. Is that correct?

  6. #6
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    Quote Originally Posted by Desstro View Post
    Thanks, thats great info. I will most likely use queries to accomplish what I am trying to do but because I am still learning and am stubborn and it is going to kill me to not figure it out, I would still like to know what the validation rule would look like given

    B4=field"Alpha" AE4=field"bravo" and AE4=field"Charlie" and lets say the field i am setting the rule for if field"delta"

    Could you please show me?

    I can't really show you since it's not something that would work for validation rule in the table design. As I mentioned, this is something you'll need to code in vba and designed around the fields/tables and cannot set up in the table design.

    And I can't show you any vba coding without field names and seeing how you've setup the table structure.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Validation Rule
    By Megan in forum Access
    Replies: 1
    Last Post: 11-05-2010, 09:45 AM
  2. Validation Rule
    By Christopher in forum Forms
    Replies: 15
    Last Post: 04-20-2010, 06:05 AM
  3. Validation Rule
    By robomose in forum Access
    Replies: 1
    Last Post: 09-09-2009, 05:59 AM
  4. Validation Rule
    By smitstev in forum Access
    Replies: 5
    Last Post: 06-30-2009, 09:58 AM
  5. Validation Rule
    By mistaken_myst in forum Database Design
    Replies: 2
    Last Post: 10-29-2007, 02:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums