1

我正在尝试在访问中创建验证规则。我想将输入的字符组合限制为现有的 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,而不是超过它,它失败并显示错误消息:

验证规则中的错误:检查中的错误...(某事,我使用的是非英语办公室(2007),所以我无法真正翻译它。)

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

我将不胜感激任何解决方案。

谢谢

4

1 回答 1

1

我建议您使用可接受代码表,建立关系并强制参照完整性。这种类型的语句不是验证的用途。然后,您可以在表单的组合框中使用表格,让用户轻松选择代码。

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

这在 Access 2010 中作为验证规则进行了测试,但太可怕了!

IN("AX","AF","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","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","HU","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","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM", "MD","MC","MN","MS","MA","MZ","MM","NA","NR","NP","NL","AN","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","TM","TC","TV", "UG","UA","AE","GB","US","UM","UY","UZ","VU","VA","VE","VN","VG","VI","WF","EH","YE","ZM","ZW")

于 2013-02-19T11:34:07.357 回答