Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2002
    Location
    By my computer, all day, every day! :)
    Posts
    22

    Question Unanswered: Microsoft Access validation check expression problem

    Hey all,

    I'm creating a database in Micrsoft Access to hold book records, so one of the fields I've got is 'Shelf Number' which is the 532.25 or whatever you get on the spine, and I'm trying to put in a validation check for the field so that it will accept "FIC" and any number under 1000 with any number of decimel places but I can't seem to get it to work. Currently I have;
    Like "FIC" Or "<1000"
    But it doesn't seem to matter what I do, I can't get it to accept all the values - either it will accept "FIC" or the numbers, not both.

    Has anyone got any ideas on how to make it work?

    Thanks,
    Essbee


    PS I think I posted this in the wrong place before... sorry, I'm new to this!

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Do you always have an "FIC" in front of the number, or are numbers without "FIC' permitted?

  3. #3
    Join Date
    Apr 2002
    Location
    By my computer, all day, every day! :)
    Posts
    22
    It's either "FIC" or the number, never both, if that helps.

    Thanks,
    Essbee.
    "Now is the time to say something profound... Nothing comes to mind."

  4. #4
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    How about:

    "FIC" or <1000

  5. #5
    Join Date
    Apr 2002
    Location
    By my computer, all day, every day! :)
    Posts
    22
    I tried that. It comes up with the message;
    "This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplyfying the expression by assigning parts of the expression to variables."

    I figure it's not exactly a complicated thing, so I've probably got it wrong somewhere. Any ideas?

    Essbee.

  6. #6
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    I just did it and didn't have a problem (see my attachment).

    Was able to enter data to the table appropriately.

    You are NOT using the LIKE operator, I hope.

  7. #7
    Join Date
    Apr 2002
    Location
    By my computer, all day, every day! :)
    Posts
    22
    Nope. I entered as follows;
    "FIC" Or <1000

    It's not accepting the data already in there, things such as 196.254 FIC and 235. And I can't add new data to the table once the expression is there because it has a problem with the expression for some reason.

    Ho hum, don't know why. Any ideas?


    Sorry!
    Essbee.

  8. #8
    Join Date
    Apr 2002
    Location
    By my computer, all day, every day! :)
    Posts
    22
    PS Which attachment?
    PPS Why, what does Like do that is bad?

    Essbee.

  9. #9
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Put the validation rule on an empty table, then append your old data.

    I got the same message you got, but, inexplicably, it saved the new table definition anyway.

    So, bottom line, ignore the error message, it appears to work anyway.

    As for the LIKE, it's extraneous. If you don't need it, don't use it.

  10. #10
    Join Date
    Apr 2002
    Location
    By my computer, all day, every day! :)
    Posts
    22

    Talking

    Thanks, it worked!

    I just told it not to scan the existing data to check for matches with the new rule, and any new data I'm adding gives the right results.

    Thanks again, you've been a great help.

    Essbee.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •