In the expression IIF[SSN]=50,99,[SSN]) when I enter 60, all works well. But if I enter 50, I get "The value entered doesn't meet the validation rule for the field or control". BTW, SSN is defined in the table as Number (Long Integer). What's the problem?

Recommended Answers

All 4 Replies

Try entering 99. If it gives the same error as when 50 is entered, i think the error occurs because the validation rule says to accept numbers between but not including 50 and 99.

The iif function has 3 parts (condition, true, and false). Your condition is SSN=50. If your condition is true, it will display 99, if the condition is false it will put in the SSN. This is based off how you wrote it anyway. What are you trying to get the expression to do anyway?

I'm trying to update a table. The true condition causes Access to abort and post the message "The value entered doesn't meet the validation rule for the field or control". BTW, SSN is defined in the table as Number (Long Integer). What's the problem?

I am unsure atm whether having the field be set as a number would cause the problem. Why not set the SSN to be a text field with an SSN input mask?

What determines whether the SSN is valid or not? Does the table currently have a bunch of SSNs and they are typed in random ways, or what is causing you to need to generate something like this?

Understanding this would help to determine what your condition needs to be.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.