访问验证规则的最大长度?

时间:2013-02-19 09:38:51

标签: ms-access

我正在尝试在访问中创建验证规则。 我想将输入的字符组合仅限制为现有的ISO 2位国家代码:

“AF”或“AX”或“AL”或“DZ”或“AS”或“AD”或“AO”或“AI”或“AQ”或“AG”或“AR”或“AM”或“AW”或“AU”或“AT”或“AZ”或“BS”或“BH”或“BD”或“BB”或“BY”或“BE”或“BZ”或“BJ”或“ BM“或”BT“或”BO“或”BQ“

它工作正常,直到我到达字符编号798,而不是它,它失败并显示错误消息:

  

验证规则出错:CHECK中出错......(我正在使用非英语办公室(2007),所以我无法真正翻译它。)

有什么想法吗?我认为这是因为长度,但它应该容纳2000个字符。我找不到任何关于验证规则中表达式的最大数量的内容。

我很感激任何解决方案。

由于

1 个答案:

答案 0 :(得分:1)

我建议您使用可接受代码表,建立关系并强制执行参照完整性。这种类型的声明不是验证的目的。然后,您可以在表单中的组合框中使用该表,以允许用户轻松选择代码。

请参阅http://office.microsoft.com/en-ie/access-help/create-edit-or-delete-a-relationship-HA010072597.aspx

这是作为Access 2010中的验证规则测试的,但它太可怕了!

  

在( “AX”, “AF”, “AL”, “DZ”, “AS”, “AD”, “AO”, “AI”, “AQ”, “AG”, “AR”,” AM”, “AW”, “AU”, “AT”, “AZ”, “BS”, “BH”, “BD”, “BB”, “靠”, “要”, “BZ”, “BJ” “BM”, “BT”, “BO”, “BA”, “BW”, “BV”, “BR”, “IO”, “BN”, “BG”, “BF”, “BI”,” KH”, “CM”, “CA”, “CV”, “KY”, “CF”, “TD”, “CL”, “CN”, “CX”, “CC”, “CO”, “KM” , “CD”, “CG”, “CK”, “CR”, “CI”, “HR”, “CU”, “CY”, “CZ”, “DK”, “DJ”, “DM”,” DO”, “EC”, “EG”, “SV”, “GQ”, “ER”, “EE”, “ET”, “FK”, “FO”, “FJ”, “FI”, “FR” , “GF”, “PF”, “TF”, “GA”, “GM”, “GE”, “DE”, “GH”, “GI”, “GR”, “GL”, “GD”,” GP”, “GU”, “GT”, “GN”, “GW”, “GY”, “HT”, “HM”, “HN”, “HK”, “胡”, “IS”, “IN” , “ID”, “IR”, “IQ”, “IE”, “IL”, “IT”, “JM”, “JP”, “JO”, “KZ”, “KE”, “KI”,” KP”, “KR”, “KW”, “KG”, “LA”, “LV”, “LB”, “LS”, “LR”, “LY”, “LI”, “LT”, “LU” , “MO”, “MK”, “MG”, “MW”, “我的”, “MV”, “ML”, “MT”, “MH”, “MQ”, “MR”, “MU”,” YT”, “MX”, “FM”, “MD”, “MC”, “MN”, “MS”, “MA”, “MZ”, “MM”, “NA”, “NR”, “NP” , “NL”, “一个”, “NC”, “NZ”, “NI”, “NE”, “NG”, “NU”, “NF”, “MP”, “NO”, “OM”,” PK”, “PW”, “PS”, “PA”, “PG”, “PY”, “PE”, “PH”, “PN”, “PL”, “PT”, “PR”, “QA” “RE”, “RO”, “RU”, “RW”, “SH”, “KN”, “LC”, “PM”, “VC”, “WS”, “SM”, “ST”,” SA”, “SN”, “CS”, “SC”, “SL”, “SG”, “SK”, “SI”, “SB”, “SO”, “ZA”, “GS”, “ES” “LK”, “SD”, “SR”, “SJ”, “SZ”, “SE”, “CH”, “SY”, “TW”, “TJ”, “TZ”, “TH”,” TL”, “TG”, “TK”, “TO”, “TT”, “TN”, “TR”, “以旧换新”, “TC”, “电视”, “UG”, “UA”, “AE” “国标”, “美”, “嗯”, “UY”, “UZ”, “VU”, “VA”, “VE”, “VN”, “VG”, “VI”, “WF”,” EH”, “叶”, “ZM”, “ZW”)