{"id":58303,"date":"2024-10-12T19:43:17","date_gmt":"2024-10-12T11:43:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/58303\/"},"modified":"2024-10-12T19:43:17","modified_gmt":"2024-10-12T11:43:17","slug":"access%e6%95%b8%e6%93%9a%e5%ba%ab%e4%b8%adfield%e5%b0%8d%e8%b1%a1%e7%9a%84caption%e5%b1%ac%e6%80%a7%e8%ae%80%e5%af%ab","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/58303\/","title":{"rendered":"ACCESS\u6578\u64da\u5eab\u4e2dField\u5c0d\u8c61\u7684caption\u5c6c\u6027\u8b80\u5beb"},"content":{"rendered":"<h1 id=\"access%e6%95%b8%e6%93%9a%e5%ba%ab%e4%b8%adfield%e5%b0%8d%e8%b1%a1%e7%9a%84caption%e5%b1%ac%e6%80%a7%e8%ae%80%e5%af%ab-XOWqcwfkby\">ACCESS\u6578\u64da\u5eab\u4e2dField\u5c0d\u8c61\u7684caption\u5c6c\u6027\u8b80\u5beb<\/h1>\n<p>\u5728Microsoft Access\u6578\u64da\u5eab\u4e2d\uff0cField\u5c0d\u8c61\u662f\u7528\u4f86\u8868\u793a\u6578\u64da\u8868\u4e2d\u7684\u4e00\u500b\u6b04\u4f4d\u3002\u6bcf\u500bField\u5c0d\u8c61\u90fd\u6709\u591a\u500b\u5c6c\u6027\uff0c\u5176\u4e2d\u4e4b\u4e00\u5c31\u662fcaption\u5c6c\u6027\u3002caption\u5c6c\u6027\u7528\u65bc\u5b9a\u7fa9\u6b04\u4f4d\u7684\u986f\u793a\u540d\u7a31\uff0c\u9019\u5c0d\u65bc\u7528\u6236\u754c\u9762\u548c\u5831\u544a\u7684\u53ef\u8b80\u6027\u81f3\u95dc\u91cd\u8981\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u5982\u4f55\u8b80\u53d6\u548c\u5beb\u5165Field\u5c0d\u8c61\u7684caption\u5c6c\u6027\uff0c\u4e26\u63d0\u4f9b\u76f8\u95dc\u7684\u793a\u4f8b\u4ee3\u78bc\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%afcaption%e5%b1%ac%e6%80%a7%ef%bc%9f-XOWqcwfkby\">\u4ec0\u9ebc\u662fcaption\u5c6c\u6027\uff1f<\/h2>\n<p>caption\u5c6c\u6027\u662fField\u5c0d\u8c61\u7684\u4e00\u500b\u53ef\u9078\u5c6c\u6027\uff0c\u4e3b\u8981\u7528\u65bc\u63d0\u4f9b\u4e00\u500b\u66f4\u53cb\u597d\u7684\u540d\u7a31\u4f86\u986f\u793a\u5728\u7528\u6236\u754c\u9762\u4e2d\u3002\u9019\u610f\u5473\u8457\u7528\u6236\u5728\u67e5\u770b\u6578\u64da\u8868\u6216\u5831\u544a\u6642\uff0c\u770b\u5230\u7684\u540d\u7a31\u53ef\u80fd\u8207\u5be6\u969b\u7684\u6b04\u4f4d\u540d\u7a31\u4e0d\u540c\u3002\u4f8b\u5982\uff0c\u6b04\u4f4d\u540d\u7a31\u53ef\u80fd\u662f\u201cFirstName\u201d\uff0c\u800c\u5176caption\u5c6c\u6027\u53ef\u4ee5\u8a2d\u7f6e\u70ba\u201c\u540d\u5b57\u201d\u3002\u9019\u6a23\u53ef\u4ee5\u63d0\u9ad8\u7528\u6236\u7684\u7406\u89e3\u548c\u64cd\u4f5c\u6548\u7387\u3002<\/p>\n<h2 id=\"%e8%ae%80%e5%8f%96caption%e5%b1%ac%e6%80%a7-XOWqcwfkby\">\u8b80\u53d6caption\u5c6c\u6027<\/h2>\n<p>\u8981\u8b80\u53d6Field\u5c0d\u8c61\u7684caption\u5c6c\u6027\uff0c\u53ef\u4ee5\u4f7f\u7528VBA\uff08Visual Basic for Applications\uff09\u7de8\u7a0b\u8a9e\u8a00\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684\u793a\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u8b80\u53d6\u4e00\u500b\u6578\u64da\u8868\u4e2d\u67d0\u500b\u6b04\u4f4d\u7684caption\u5c6c\u6027\uff1a<\/p>\n<pre><code>Dim db As DAO.Database\nDim tdf As DAO.TableDef\nDim fld As DAO.Field\n\nSet db = CurrentDb()\nSet tdf = db.TableDefs(\"YourTableName\") ' \u66ff\u63db\u70ba\u4f60\u7684\u8868\u540d\nSet fld = tdf.Fields(\"YourFieldName\") ' \u66ff\u63db\u70ba\u4f60\u7684\u6b04\u4f4d\u540d\n\nMsgBox \"\u6b04\u4f4d\u7684caption\u662f: \" &amp; fld.Caption\n<\/code><\/pre>\n<p>\u5728\u9019\u6bb5\u4ee3\u78bc\u4e2d\uff0c\u6211\u5011\u9996\u5148\u7372\u53d6\u7576\u524d\u6578\u64da\u5eab\u7684\u5f15\u7528\uff0c\u7136\u5f8c\u7372\u53d6\u6307\u5b9a\u8868\u7684TableDef\u5c0d\u8c61\uff0c\u63a5\u8457\u7372\u53d6\u6307\u5b9a\u6b04\u4f4d\u7684Field\u5c0d\u8c61\uff0c\u6700\u5f8c\u901a\u904eMsgBox\u986f\u793a\u8a72\u6b04\u4f4d\u7684caption\u5c6c\u6027\u3002<\/p>\n<h2 id=\"%e5%af%ab%e5%85%a5caption%e5%b1%ac%e6%80%a7-XOWqcwfkby\">\u5beb\u5165caption\u5c6c\u6027<\/h2>\n<p>\u9664\u4e86\u8b80\u53d6caption\u5c6c\u6027\uff0c\u6211\u5011\u9084\u53ef\u4ee5\u901a\u904eVBA\u4f86\u4fee\u6539\u5b83\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u8a2d\u7f6eField\u5c0d\u8c61\u7684caption\u5c6c\u6027\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code>Dim db As DAO.Database\nDim tdf As DAO.TableDef\nDim fld As DAO.Field\n\nSet db = CurrentDb()\nSet tdf = db.TableDefs(\"YourTableName\") ' \u66ff\u63db\u70ba\u4f60\u7684\u8868\u540d\nSet fld = tdf.Fields(\"YourFieldName\") ' \u66ff\u63db\u70ba\u4f60\u7684\u6b04\u4f4d\u540d\n\nfld.Caption = \"\u65b0\u7684\u540d\u5b57\" ' \u8a2d\u7f6e\u65b0\u7684caption\ntdf.Fields.Refresh ' \u5237\u65b0\u4ee5\u61c9\u7528\u66f4\u6539\nMsgBox \"\u6b04\u4f4d\u7684caption\u5df2\u66f4\u65b0\u70ba: \" &amp; fld.Caption\n<\/code><\/pre>\n<p>\u5728\u9019\u6bb5\u4ee3\u78bc\u4e2d\uff0c\u6211\u5011\u5c07\u6307\u5b9a\u6b04\u4f4d\u7684caption\u5c6c\u6027\u8a2d\u7f6e\u70ba\u201c\u65b0\u7684\u540d\u5b57\u201d\u3002\u4fee\u6539\u5f8c\uff0c\u4f7f\u7528tdf.Fields.Refresh\u65b9\u6cd5\u4f86\u78ba\u4fdd\u66f4\u6539\u88ab\u61c9\u7528\u3002<\/p>\n<h2 id=\"caption%e5%b1%ac%e6%80%a7%e7%9a%84%e6%87%89%e7%94%a8%e5%a0%b4%e6%99%af-XOWqcwfkby\">caption\u5c6c\u6027\u7684\u61c9\u7528\u5834\u666f<\/h2>\n<p>caption\u5c6c\u6027\u5728\u591a\u7a2e\u60c5\u6cc1\u4e0b\u90fd\u975e\u5e38\u6709\u7528\u3002\u4f8b\u5982\uff0c\u5728\u8a2d\u8a08\u5831\u544a\u6642\uff0c\u4f7f\u7528caption\u5c6c\u6027\u53ef\u4ee5\u4f7f\u5831\u544a\u7684\u6a19\u984c\u66f4\u52a0\u6e05\u6670\u6613\u61c2\u3002\u6b64\u5916\uff0c\u5728\u5275\u5efa\u7528\u6236\u8868\u55ae\u6642\uff0ccaption\u5c6c\u6027\u53ef\u4ee5\u5e6b\u52a9\u7528\u6236\u66f4\u5feb\u5730\u7406\u89e3\u6bcf\u500b\u6b04\u4f4d\u7684\u7528\u9014\uff0c\u5f9e\u800c\u63d0\u9ad8\u6578\u64da\u8f38\u5165\u7684\u6548\u7387\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-XOWqcwfkby\">\u7e3d\u7d50<\/h2>\n<p>\u5728ACCESS\u6578\u64da\u5eab\u4e2d\uff0cField\u5c0d\u8c61\u7684caption\u5c6c\u6027\u662f\u4e00\u500b\u91cd\u8981\u7684\u5de5\u5177\uff0c\u80fd\u5920\u63d0\u9ad8\u6578\u64da\u7684\u53ef\u8b80\u6027\u548c\u7528\u6236\u9ad4\u9a57\u3002\u901a\u904eVBA\u7de8\u7a0b\uff0c\u6211\u5011\u53ef\u4ee5\u8f15\u9b06\u5730\u8b80\u53d6\u548c\u4fee\u6539\u9019\u4e00\u5c6c\u6027\uff0c\u4ee5\u6eff\u8db3\u4e0d\u540c\u7684\u9700\u6c42\u3002\u7121\u8ad6\u662f\u5728\u5831\u544a\u8a2d\u8a08\u9084\u662f\u7528\u6236\u754c\u9762\u958b\u767c\u4e2d\uff0c\u5408\u7406\u4f7f\u7528caption\u5c6c\u6027\u90fd\u80fd\u986f\u8457\u63d0\u5347\u5de5\u4f5c\u6548\u7387\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5c0d\u65bc\u6578\u64da\u5eab\u7ba1\u7406\u6216\u5176\u4ed6\u6280\u8853\u89e3\u6c7a\u65b9\u6848\u6709\u8208\u8da3\uff0c\u6b61\u8fce\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4e86\u89e3\u66f4\u591a\u8cc7\u8a0a\uff0c\u7279\u5225\u662f\u6211\u5011\u7684<a href=\"https:\/\/server.hk\">VPS<\/a>\u548c<a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a>\u670d\u52d9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u5982\u4f55\u5728ACCESS\u6578\u64da\u5eab\u4e2d\u8b80\u5bebField\u5c0d\u8c61\u7684caption\u5c6c\u6027\uff0c\u63d0\u5347\u6578\u64da\u7ba1\u7406\u7684\u9748\u6d3b\u6027\u8207\u53ef\u8b80\u6027\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-58303","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/58303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=58303"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/58303\/revisions"}],"predecessor-version":[{"id":58304,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/58303\/revisions\/58304"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=58303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=58303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=58303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}