<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Thủ Thuật Access - Thủ thuật VBA]]></title>
		<link>https://thuthuataccess.com/forum/</link>
		<description><![CDATA[Thủ Thuật Access - https://thuthuataccess.com/forum]]></description>
		<pubDate>Sat, 18 Apr 2026 13:42:02 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Kết nối bảng từ access A đến access B]]></title>
			<link>https://thuthuataccess.com/forum/thread-13040.html</link>
			<pubDate>Tue, 09 Apr 2024 05:08:46 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=22515">hieunx</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-13040.html</guid>
			<description><![CDATA[Mình có thiết kế cơ sở dữ liệu cho 6 phường trên địa bàn của mình để theo dõi hồ sơ thu phí lệ phí. Mỗi phường 1 data riêng.<br />
Nay mình cần gom lại chung. Nhờ anh chị diên đàn giúp mình. Mình gửi demo nhờ anh chị xem giúp ạ.<br />
Mình có: App.accdb (chưa form, table thì link tới P1, hoặc P2, chưa table có tên và cấu trúc giống nhau).<br />
Trên App.accdb, mình có 1 form, gồm 2 nút lệnh. có thể giúp mình khi bấm nút Data1 thì mở form "hoSoThuPhi" và table thì link đến table ở P1.accdb, còn khi bấm Data2 thì  mở form "hoSoThuPhi" và table thì link đến table ở P2.accdb<br />
Mình mới tập tành về VBA nên mong các anh chị giúp đỡ.<br />
File đính kèm: <a href="https://drive.google.com/file/d/1o5Qf8bla48LjVQt1HC6ypX5X6URLh_lw/view?usp=sharing" target="_blank" rel="noopener" class="mycode_url">https://drive.google.com/file/d/1o5Qf8bl...sp=sharing</a>]]></description>
			<content:encoded><![CDATA[Mình có thiết kế cơ sở dữ liệu cho 6 phường trên địa bàn của mình để theo dõi hồ sơ thu phí lệ phí. Mỗi phường 1 data riêng.<br />
Nay mình cần gom lại chung. Nhờ anh chị diên đàn giúp mình. Mình gửi demo nhờ anh chị xem giúp ạ.<br />
Mình có: App.accdb (chưa form, table thì link tới P1, hoặc P2, chưa table có tên và cấu trúc giống nhau).<br />
Trên App.accdb, mình có 1 form, gồm 2 nút lệnh. có thể giúp mình khi bấm nút Data1 thì mở form "hoSoThuPhi" và table thì link đến table ở P1.accdb, còn khi bấm Data2 thì  mở form "hoSoThuPhi" và table thì link đến table ở P2.accdb<br />
Mình mới tập tành về VBA nên mong các anh chị giúp đỡ.<br />
File đính kèm: <a href="https://drive.google.com/file/d/1o5Qf8bla48LjVQt1HC6ypX5X6URLh_lw/view?usp=sharing" target="_blank" rel="noopener" class="mycode_url">https://drive.google.com/file/d/1o5Qf8bl...sp=sharing</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Kết nối Excel vs Access bằng ADODB - Truy vấn bị lỗi khi tên sheet trong Excel ko đặt]]></title>
			<link>https://thuthuataccess.com/forum/thread-12691.html</link>
			<pubDate>Wed, 25 Oct 2023 08:30:04 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=16191">subasatran</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12691.html</guid>
			<description><![CDATA[Xin chào A/C/E và mọi người.<br />
Em có sử dụng kết nối ADODB kết nối Excel và Access để import data từ excel vào access để xử lý dữ liệu.<br />
Tuy nhiên, khi chạy code import thì bị gặp lỗi như sau :<br />
<span style="font-weight: bold;" class="mycode_b">Nếu tên Sheet của file Excel được đặt tên thì code chạy ổn(ví dụ như tên sheet là Data).<br />
</span><br />
<div class="codeblock phpcodeblock"><div class="title">Mã PHP:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB"> &nbsp; &nbsp;Set&nbsp;rs&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CreateObject</span><span style="color: #007700">(</span><span style="color: #DD0000">"ADODB.Recordset"</span><span style="color: #007700">)<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;FilePath&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CurrentProject</span><span style="color: #007700">.</span><span style="color: #0000BB">Path&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #DD0000">"&#092;"&nbsp;&amp;&nbsp;FileName&nbsp;&amp;&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">xlsx</span><span style="color: #DD0000">"<br /> &nbsp; &nbsp;SQL&nbsp;=&nbsp;"</span><span style="color: #0000BB">select&nbsp;</span><span style="color: #007700">*&nbsp;</span><span style="color: #0000BB">from&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">Data&#36;A1</span><span style="color: #007700">:</span><span style="color: #0000BB">AA</span><span style="color: #007700">]</span><span style="color: #DD0000">"<br /> &nbsp; &nbsp;Strconnect&nbsp;=&nbsp;("</span><span style="color: #0000BB">Provider</span><span style="color: #007700">=</span><span style="color: #0000BB">Microsoft</span><span style="color: #007700">.</span><span style="color: #0000BB">ACE</span><span style="color: #007700">.</span><span style="color: #0000BB">OLEDB.12.0</span><span style="color: #007700">;</span><span style="color: #0000BB">Data&nbsp;Source</span><span style="color: #007700">=</span><span style="color: #DD0000">"&nbsp;&amp;&nbsp;FilePath&nbsp;_<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;&nbsp;"</span><span style="color: #007700">;</span><span style="color: #0000BB">Extended&nbsp;Properties</span><span style="color: #007700">=</span><span style="color: #DD0000">""</span><span style="color: #0000BB">Excel&nbsp;12.0&nbsp;Xml</span><span style="color: #007700">;</span><span style="color: #0000BB">HDR</span><span style="color: #007700">=</span><span style="color: #0000BB">Yes</span><span style="color: #007700">;</span><span style="color: #DD0000">""</span><span style="color: #007700">;</span><span style="color: #DD0000">")<br /> &nbsp; &nbsp;rs.Open&nbsp;SQL,&nbsp;Strconnect,&nbsp;3,&nbsp;1&nbsp;<br /></span></code></div></div></div><span style="font-weight: bold;" class="mycode_b">Trong trường hợp nếu tên Sheet trong file excel không được đặt tên(có nghĩa là để nguyên mặc định Sheet1).</span><br />
Thì code import báo lỗi ở câu lệnh SQL.<br />
<div class="codeblock phpcodeblock"><div class="title">Mã PHP:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB"> &nbsp; &nbsp;Set&nbsp;rs&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CreateObject</span><span style="color: #007700">(</span><span style="color: #DD0000">"ADODB.Recordset"</span><span style="color: #007700">)<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;FilePath&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CurrentProject</span><span style="color: #007700">.</span><span style="color: #0000BB">Path&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #DD0000">"&#092;"&nbsp;&amp;&nbsp;FileName&nbsp;&amp;&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">xlsx</span><span style="color: #DD0000">"<br /> &nbsp; &nbsp;SQL&nbsp;=&nbsp;"</span><span style="color: #0000BB">select&nbsp;</span><span style="color: #007700">*&nbsp;</span><span style="color: #0000BB">from&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">Sheet1&#36;A1</span><span style="color: #007700">:</span><span style="color: #0000BB">AA</span><span style="color: #007700">]</span><span style="color: #DD0000">"<br /> &nbsp; &nbsp;Strconnect&nbsp;=&nbsp;("</span><span style="color: #0000BB">Provider</span><span style="color: #007700">=</span><span style="color: #0000BB">Microsoft</span><span style="color: #007700">.</span><span style="color: #0000BB">ACE</span><span style="color: #007700">.</span><span style="color: #0000BB">OLEDB.12.0</span><span style="color: #007700">;</span><span style="color: #0000BB">Data&nbsp;Source</span><span style="color: #007700">=</span><span style="color: #DD0000">"&nbsp;&amp;&nbsp;FilePath&nbsp;_<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;&nbsp;"</span><span style="color: #007700">;</span><span style="color: #0000BB">Extended&nbsp;Properties</span><span style="color: #007700">=</span><span style="color: #DD0000">""</span><span style="color: #0000BB">Excel&nbsp;12.0&nbsp;Xml</span><span style="color: #007700">;</span><span style="color: #0000BB">HDR</span><span style="color: #007700">=</span><span style="color: #0000BB">Yes</span><span style="color: #007700">;</span><span style="color: #DD0000">""</span><span style="color: #007700">;</span><span style="color: #DD0000">")<br /> &nbsp; &nbsp;rs.Open&nbsp;SQL,&nbsp;Strconnect,&nbsp;3,&nbsp;1&nbsp;<br /></span></code></div></div></div>Vậy mọi người cho em hỏi là : <br />
a. nguyên nhân báo lỗi là do đâu vậy ?<br />
b.Làm sao để khi tên sheet của file excel để nguyên mặc dịnh là Sheet1 thì code vẫn chạy được ạ ?do các file excel này được exporrt từ hệ thống và rất nhiều file nên không thể mở từng file để đặt tên sheet được<br />
Rất cám ơn mọi người.]]></description>
			<content:encoded><![CDATA[Xin chào A/C/E và mọi người.<br />
Em có sử dụng kết nối ADODB kết nối Excel và Access để import data từ excel vào access để xử lý dữ liệu.<br />
Tuy nhiên, khi chạy code import thì bị gặp lỗi như sau :<br />
<span style="font-weight: bold;" class="mycode_b">Nếu tên Sheet của file Excel được đặt tên thì code chạy ổn(ví dụ như tên sheet là Data).<br />
</span><br />
<div class="codeblock phpcodeblock"><div class="title">Mã PHP:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB"> &nbsp; &nbsp;Set&nbsp;rs&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CreateObject</span><span style="color: #007700">(</span><span style="color: #DD0000">"ADODB.Recordset"</span><span style="color: #007700">)<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;FilePath&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CurrentProject</span><span style="color: #007700">.</span><span style="color: #0000BB">Path&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #DD0000">"&#092;"&nbsp;&amp;&nbsp;FileName&nbsp;&amp;&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">xlsx</span><span style="color: #DD0000">"<br /> &nbsp; &nbsp;SQL&nbsp;=&nbsp;"</span><span style="color: #0000BB">select&nbsp;</span><span style="color: #007700">*&nbsp;</span><span style="color: #0000BB">from&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">Data&#36;A1</span><span style="color: #007700">:</span><span style="color: #0000BB">AA</span><span style="color: #007700">]</span><span style="color: #DD0000">"<br /> &nbsp; &nbsp;Strconnect&nbsp;=&nbsp;("</span><span style="color: #0000BB">Provider</span><span style="color: #007700">=</span><span style="color: #0000BB">Microsoft</span><span style="color: #007700">.</span><span style="color: #0000BB">ACE</span><span style="color: #007700">.</span><span style="color: #0000BB">OLEDB.12.0</span><span style="color: #007700">;</span><span style="color: #0000BB">Data&nbsp;Source</span><span style="color: #007700">=</span><span style="color: #DD0000">"&nbsp;&amp;&nbsp;FilePath&nbsp;_<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;&nbsp;"</span><span style="color: #007700">;</span><span style="color: #0000BB">Extended&nbsp;Properties</span><span style="color: #007700">=</span><span style="color: #DD0000">""</span><span style="color: #0000BB">Excel&nbsp;12.0&nbsp;Xml</span><span style="color: #007700">;</span><span style="color: #0000BB">HDR</span><span style="color: #007700">=</span><span style="color: #0000BB">Yes</span><span style="color: #007700">;</span><span style="color: #DD0000">""</span><span style="color: #007700">;</span><span style="color: #DD0000">")<br /> &nbsp; &nbsp;rs.Open&nbsp;SQL,&nbsp;Strconnect,&nbsp;3,&nbsp;1&nbsp;<br /></span></code></div></div></div><span style="font-weight: bold;" class="mycode_b">Trong trường hợp nếu tên Sheet trong file excel không được đặt tên(có nghĩa là để nguyên mặc định Sheet1).</span><br />
Thì code import báo lỗi ở câu lệnh SQL.<br />
<div class="codeblock phpcodeblock"><div class="title">Mã PHP:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB"> &nbsp; &nbsp;Set&nbsp;rs&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CreateObject</span><span style="color: #007700">(</span><span style="color: #DD0000">"ADODB.Recordset"</span><span style="color: #007700">)<br /></span><span style="color: #0000BB"> &nbsp; &nbsp;FilePath&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CurrentProject</span><span style="color: #007700">.</span><span style="color: #0000BB">Path&nbsp;</span><span style="color: #007700">&amp;&nbsp;</span><span style="color: #DD0000">"&#092;"&nbsp;&amp;&nbsp;FileName&nbsp;&amp;&nbsp;"</span><span style="color: #007700">.</span><span style="color: #0000BB">xlsx</span><span style="color: #DD0000">"<br /> &nbsp; &nbsp;SQL&nbsp;=&nbsp;"</span><span style="color: #0000BB">select&nbsp;</span><span style="color: #007700">*&nbsp;</span><span style="color: #0000BB">from&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">Sheet1&#36;A1</span><span style="color: #007700">:</span><span style="color: #0000BB">AA</span><span style="color: #007700">]</span><span style="color: #DD0000">"<br /> &nbsp; &nbsp;Strconnect&nbsp;=&nbsp;("</span><span style="color: #0000BB">Provider</span><span style="color: #007700">=</span><span style="color: #0000BB">Microsoft</span><span style="color: #007700">.</span><span style="color: #0000BB">ACE</span><span style="color: #007700">.</span><span style="color: #0000BB">OLEDB.12.0</span><span style="color: #007700">;</span><span style="color: #0000BB">Data&nbsp;Source</span><span style="color: #007700">=</span><span style="color: #DD0000">"&nbsp;&amp;&nbsp;FilePath&nbsp;_<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&amp;&nbsp;"</span><span style="color: #007700">;</span><span style="color: #0000BB">Extended&nbsp;Properties</span><span style="color: #007700">=</span><span style="color: #DD0000">""</span><span style="color: #0000BB">Excel&nbsp;12.0&nbsp;Xml</span><span style="color: #007700">;</span><span style="color: #0000BB">HDR</span><span style="color: #007700">=</span><span style="color: #0000BB">Yes</span><span style="color: #007700">;</span><span style="color: #DD0000">""</span><span style="color: #007700">;</span><span style="color: #DD0000">")<br /> &nbsp; &nbsp;rs.Open&nbsp;SQL,&nbsp;Strconnect,&nbsp;3,&nbsp;1&nbsp;<br /></span></code></div></div></div>Vậy mọi người cho em hỏi là : <br />
a. nguyên nhân báo lỗi là do đâu vậy ?<br />
b.Làm sao để khi tên sheet của file excel để nguyên mặc dịnh là Sheet1 thì code vẫn chạy được ạ ?do các file excel này được exporrt từ hệ thống và rất nhiều file nên không thể mở từng file để đặt tên sheet được<br />
Rất cám ơn mọi người.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Xử lý dữ liệu trong subform sau khi đã bị đóng Recordset trước đó]]></title>
			<link>https://thuthuataccess.com/forum/thread-12660.html</link>
			<pubDate>Wed, 02 Aug 2023 09:40:06 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=19824">AnNguyen</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12660.html</guid>
			<description><![CDATA[Em sử dụng kết nối ADODB và thường đổ dữ liệu Recordset về subform.<br />
Nhưng có 1 điểm mà em chưa biết giải quyết sao.<br />
<br />
nếu sau mỗi câu lệnh : <br />
<div class="codeblock phpcodeblock"><div class="title">Mã PHP:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">set&nbsp;SubformABC</span><span style="color: #007700">.</span><span style="color: #0000BB">form</span><span style="color: #007700">.</span><span style="color: #0000BB">recordset&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">rst<br />rst</span><span style="color: #007700">.</span><span style="color: #0000BB">close<br />conn</span><span style="color: #007700">.</span><span style="color: #0000BB">close&nbsp;<br /></span></code></div></div></div><br />
<br />
Thì sẽ xảy ra vấn đề nếu thao tác với subform như, lấy giá trị trong subform bằng<br />
<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">Mã PHP:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">While&nbsp;</span><span style="color: #0000BB">not&nbsp;rst</span><span style="color: #007700">.</span><span style="color: #0000BB">EOF<br /></span><span style="color: #007700">.......<br /></span><span style="color: #0000BB">wend&nbsp;<br /></span></code></div></div></div><br />
<br />
thì luôn bị lỗi do đã đóng kết nối và đóng Recordset.<br />
Vì vậy trong ứng dụng của em luôn luôn không đóng kết nối và em cũng biết điều này ảnh hưởng đến tốc độ và hiệu năng sử dụng.<br />
Nếu recordset được đổ vào listbox hoặc combobox thì dữ liệu vẫn xử lý được do dùng vòng lặp For là có thể lấy được giá trị trong đó ra.<br />
Nhưng riêng với subform thì không thể.<br />
Vậy có cách nào để cải thiện không ạ?<br />
Em cảm ơn!]]></description>
			<content:encoded><![CDATA[Em sử dụng kết nối ADODB và thường đổ dữ liệu Recordset về subform.<br />
Nhưng có 1 điểm mà em chưa biết giải quyết sao.<br />
<br />
nếu sau mỗi câu lệnh : <br />
<div class="codeblock phpcodeblock"><div class="title">Mã PHP:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB">set&nbsp;SubformABC</span><span style="color: #007700">.</span><span style="color: #0000BB">form</span><span style="color: #007700">.</span><span style="color: #0000BB">recordset&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">rst<br />rst</span><span style="color: #007700">.</span><span style="color: #0000BB">close<br />conn</span><span style="color: #007700">.</span><span style="color: #0000BB">close&nbsp;<br /></span></code></div></div></div><br />
<br />
Thì sẽ xảy ra vấn đề nếu thao tác với subform như, lấy giá trị trong subform bằng<br />
<br />
<br />
<div class="codeblock phpcodeblock"><div class="title">Mã PHP:</div><div class="body"><div dir="ltr"><code><span style="color: #007700">While&nbsp;</span><span style="color: #0000BB">not&nbsp;rst</span><span style="color: #007700">.</span><span style="color: #0000BB">EOF<br /></span><span style="color: #007700">.......<br /></span><span style="color: #0000BB">wend&nbsp;<br /></span></code></div></div></div><br />
<br />
thì luôn bị lỗi do đã đóng kết nối và đóng Recordset.<br />
Vì vậy trong ứng dụng của em luôn luôn không đóng kết nối và em cũng biết điều này ảnh hưởng đến tốc độ và hiệu năng sử dụng.<br />
Nếu recordset được đổ vào listbox hoặc combobox thì dữ liệu vẫn xử lý được do dùng vòng lặp For là có thể lấy được giá trị trong đó ra.<br />
Nhưng riêng với subform thì không thể.<br />
Vậy có cách nào để cải thiện không ạ?<br />
Em cảm ơn!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Đẩy file word.doc lên googdriver và mở file đó bằng VBA]]></title>
			<link>https://thuthuataccess.com/forum/thread-12658.html</link>
			<pubDate>Mon, 31 Jul 2023 12:42:20 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=11870">tt1212</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12658.html</guid>
			<description><![CDATA[Mình có ý tưởng đẩy file word lên google và mở fie d dó ra để làm sau đó dữ liệu được lưu trên word và tạo bảng lưu lại đưog linjk bà tìm kiếm trên acess<br />
bạn nào đã từng làm trao đổi hỗ trợ minh được không]]></description>
			<content:encoded><![CDATA[Mình có ý tưởng đẩy file word lên google và mở fie d dó ra để làm sau đó dữ liệu được lưu trên word và tạo bảng lưu lại đưog linjk bà tìm kiếm trên acess<br />
bạn nào đã từng làm trao đổi hỗ trợ minh được không]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Xuất ra Excel không mong muốn]]></title>
			<link>https://thuthuataccess.com/forum/thread-12636.html</link>
			<pubDate>Wed, 28 Jun 2023 10:15:34 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=20349">Accessv07</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12636.html</guid>
			<description><![CDATA[Sau khi xuất ra Excel từ bài viết của <span style="color: #c10300;" class="mycode_color">ongke0711</span>, Query dạng <span style="color: #ffff44;" class="mycode_color">.</span><span style="color: #00369b;" class="mycode_color">Range("A2").CopyFromRecordset rs</span><br />
thì ô Excel hiển thị "=0.95*100" mà không hiển thị kết quả "95"<br />
và tôi phải chạy để ra kết quả "95"<br />
<div class="codeblock phpcodeblock"><div class="title">Mã PHP:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">For&nbsp;</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1&nbsp;To&nbsp;rs</span><span style="color: #007700">.</span><span style="color: #0000BB">RecordCount&nbsp;Step&nbsp;1<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ki&nbsp;</span><span style="color: #007700">=&nbsp;(.</span><span style="color: #0000BB">Cells</span><span style="color: #007700">(</span><span style="color: #0000BB">i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">7</span><span style="color: #007700">).</span><span style="color: #0000BB">Value</span><span style="color: #007700">)<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">If&nbsp;</span><span style="color: #0000BB">ki&nbsp;</span><span style="color: #007700">&lt;&gt;&nbsp;</span><span style="color: #DD0000">""&nbsp;</span><span style="color: #0000BB">Then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">.</span><span style="color: #0000BB">Cells</span><span style="color: #007700">(</span><span style="color: #0000BB">i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">7</span><span style="color: #007700">).</span><span style="color: #0000BB">Value&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ki<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End&nbsp;</span><span style="color: #007700">If<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;Next&nbsp;i&nbsp;<br /></span></code></div></div></div><br />
Thêm dòng lệnh làm cho ứng dụng chạy chậm, vậy có cách nào khác gán .value "=0.95*100" bằng công thức "95" nhanh gọn không?  <img src="https://thuthuataccess.com/forum/../backlink/images/smilies/Zing/027.gif" alt="027" title="027" class="smilie smilie_219" />]]></description>
			<content:encoded><![CDATA[Sau khi xuất ra Excel từ bài viết của <span style="color: #c10300;" class="mycode_color">ongke0711</span>, Query dạng <span style="color: #ffff44;" class="mycode_color">.</span><span style="color: #00369b;" class="mycode_color">Range("A2").CopyFromRecordset rs</span><br />
thì ô Excel hiển thị "=0.95*100" mà không hiển thị kết quả "95"<br />
và tôi phải chạy để ra kết quả "95"<br />
<div class="codeblock phpcodeblock"><div class="title">Mã PHP:</div><div class="body"><div dir="ltr"><code><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">For&nbsp;</span><span style="color: #0000BB">i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1&nbsp;To&nbsp;rs</span><span style="color: #007700">.</span><span style="color: #0000BB">RecordCount&nbsp;Step&nbsp;1<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ki&nbsp;</span><span style="color: #007700">=&nbsp;(.</span><span style="color: #0000BB">Cells</span><span style="color: #007700">(</span><span style="color: #0000BB">i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">7</span><span style="color: #007700">).</span><span style="color: #0000BB">Value</span><span style="color: #007700">)<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">If&nbsp;</span><span style="color: #0000BB">ki&nbsp;</span><span style="color: #007700">&lt;&gt;&nbsp;</span><span style="color: #DD0000">""&nbsp;</span><span style="color: #0000BB">Then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #007700">.</span><span style="color: #0000BB">Cells</span><span style="color: #007700">(</span><span style="color: #0000BB">i</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">7</span><span style="color: #007700">).</span><span style="color: #0000BB">Value&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ki<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;End&nbsp;</span><span style="color: #007700">If<br /></span><span style="color: #0000BB"> &nbsp; &nbsp; &nbsp; &nbsp;Next&nbsp;i&nbsp;<br /></span></code></div></div></div><br />
Thêm dòng lệnh làm cho ứng dụng chạy chậm, vậy có cách nào khác gán .value "=0.95*100" bằng công thức "95" nhanh gọn không?  <img src="https://thuthuataccess.com/forum/../backlink/images/smilies/Zing/027.gif" alt="027" title="027" class="smilie smilie_219" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Bị báo lỗi "Method or data member not found"]]></title>
			<link>https://thuthuataccess.com/forum/thread-12632.html</link>
			<pubDate>Fri, 23 Jun 2023 07:45:54 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=19532">longkd_bvct@yahoo.com.vn</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12632.html</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Mã:</div><div class="body" dir="ltr"><code>Sub TimGiaTriTrungNhau()<br />
    Dim db As DAO.Database<br />
    Dim rs1 As DAO.Recordsets<br />
    Dim rs2 As DAO.Recordsets<br />
    Dim giaTri As Variant<br />
    Dim trungNhau As String<br />
  <br />
  Set db = CurrentDb<br />
  Set rs1 = CurrentDb.OpenRecordset(qrydaxuat)<br />
  Set rs2 = CurrentDb.OpenRecordset(tbldanhap)<br />
rs1.MoveFirst<br />
Do Until rs1.EOF<br />
giaTri = rs1.Fields("MaHH").Value<br />
        rs2.FindFirst "MaHH='" &amp; giaTri &amp; "'"<br />
        If Not rs2.NoMatch Then<br />
            trungNhau = trungNhau &amp; giaTri &amp; ", "<br />
        End If<br />
        rs1.MoveNext<br />
Loop<br />
    rs1.Close<br />
    rs2.Close<br />
    db.Close<br />
    If Len(trungNhau) &gt; 0 Then<br />
        trungNhau = Left(trungNhau, Len(trungNhau) - 2)<br />
    End If<br />
    MsgBox "Các giá tr? trùng nhau: " &amp; trungNhau<br />
End Sub</code></div></div><br />
Mọi người xem giúp em bị sai chổ nào mà khi chạy lại báo lỗi: "Method or data member not found" ạ]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Mã:</div><div class="body" dir="ltr"><code>Sub TimGiaTriTrungNhau()<br />
    Dim db As DAO.Database<br />
    Dim rs1 As DAO.Recordsets<br />
    Dim rs2 As DAO.Recordsets<br />
    Dim giaTri As Variant<br />
    Dim trungNhau As String<br />
  <br />
  Set db = CurrentDb<br />
  Set rs1 = CurrentDb.OpenRecordset(qrydaxuat)<br />
  Set rs2 = CurrentDb.OpenRecordset(tbldanhap)<br />
rs1.MoveFirst<br />
Do Until rs1.EOF<br />
giaTri = rs1.Fields("MaHH").Value<br />
        rs2.FindFirst "MaHH='" &amp; giaTri &amp; "'"<br />
        If Not rs2.NoMatch Then<br />
            trungNhau = trungNhau &amp; giaTri &amp; ", "<br />
        End If<br />
        rs1.MoveNext<br />
Loop<br />
    rs1.Close<br />
    rs2.Close<br />
    db.Close<br />
    If Len(trungNhau) &gt; 0 Then<br />
        trungNhau = Left(trungNhau, Len(trungNhau) - 2)<br />
    End If<br />
    MsgBox "Các giá tr? trùng nhau: " &amp; trungNhau<br />
End Sub</code></div></div><br />
Mọi người xem giúp em bị sai chổ nào mà khi chạy lại báo lỗi: "Method or data member not found" ạ]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Câu lệnh VBA không chạy]]></title>
			<link>https://thuthuataccess.com/forum/thread-12608.html</link>
			<pubDate>Wed, 26 Apr 2023 08:40:17 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=20948">hoat</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12608.html</guid>
			<description><![CDATA[Xin chào toàn thể anh chị em.<br />
Mình có 1 form nhập liệu có các text box và check box như sau:<br />
Text box:  txtGiatriPO,  txtTonggiatriPOcoVAT,  txtDongtienthanhtoan,  txtSotiencanthanhtoanVND,  txtSotiencanthanhtoanUSD, ......<br />
và 1 check box:  cboxVAT_TU.<br />
Mình muốn viết sự kiên cho check box:  cboxVAT_TU để tính số tiền cho 2 tex box:  txtSotiencanthanhtoanVND,  txtSotiencanthanhtoanUSD<br />
với các điều kiện như sau:<br />
Nếu  txtDongtienthanhtoan = "VND" thì  txtSotiencanthanhtoanUSD = 0<br />
Nếu txtDongtienthanhtoan = "VND" và txtTamung = “Da thanh toan” và txtThanhtoanL1 = “Da thanh toan” và txtThanhtoanL2 = “Da thanh toan” và txtThanhtoanL3 = “Da thanh toan” thì  txtSotiencanthanhtoanVND = 0<br />
Nếu txtDongtienthanhtoan = "VND" và txtTamung = “Da thanh toan” và txtThanhtoanL1 = “Da thanh toan” và txtThanhtoanL2 = “Da thanh toan” và txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then<br />
    txtSotiencanthanhtoanVND = txtSotienthanhtoanL3VND<br />
...... cư lần lượt như vậy. Mình đã viết đoạn mã VBA sau mà không tính được, nhờ anh chị em xem giúp<br />
<br />
Private Sub cboxVAT_TU_Click()<br />
<div style="text-align: left;" class="mycode_align">If txtDongtienthanhtoan = "VND" And cboxVAT_TU = True Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungVND = txtTonggiatriPOcoVAT * txtGiatriphantramtamung</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungUSD = 0</div>
<div style="text-align: left;" class="mycode_align">    ElseIf txtDongtienthanhtoan = "VND" And cboxVAT_TU = False Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungVND = txtGiatriPO * txtGiatriphantramtamung</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungUSD  = 0</div>
<div style="text-align: left;" class="mycode_align">Else</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And cboxVAT_TU = True Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungUSD  = txtTonggiatriPOcoVAT * txtGiatriphantramtamung</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungVND = 0</div>
<div style="text-align: left;" class="mycode_align">    ElseIf txtDongtienthanhtoan &lt;&gt; "VND" And cboxVAT_TU = False Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungUSD  = txtGiatriPO * txtGiatriphantramtamung</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungVND = 0</div>
<div style="text-align: left;" class="mycode_align">End If</div>
<div style="text-align: left;" class="mycode_align"> </div>
<div style="text-align: left;" class="mycode_align">If txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = 0</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotientamungVND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotientamungVND + txtSotienthanhtoanL1VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotientamungVND + txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotientamungVND + txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotienthanhtoanL1VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = 0</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotientamungVND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotientamungVND + txtSotienthanhtoanL1VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotientamungVND + txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotientamungVND + txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotienthanhtoanL1VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">End If</div>
<div style="text-align: left;" class="mycode_align">End If</div>
<div style="text-align: left;" class="mycode_align"> </div>
End Sub]]></description>
			<content:encoded><![CDATA[Xin chào toàn thể anh chị em.<br />
Mình có 1 form nhập liệu có các text box và check box như sau:<br />
Text box:  txtGiatriPO,  txtTonggiatriPOcoVAT,  txtDongtienthanhtoan,  txtSotiencanthanhtoanVND,  txtSotiencanthanhtoanUSD, ......<br />
và 1 check box:  cboxVAT_TU.<br />
Mình muốn viết sự kiên cho check box:  cboxVAT_TU để tính số tiền cho 2 tex box:  txtSotiencanthanhtoanVND,  txtSotiencanthanhtoanUSD<br />
với các điều kiện như sau:<br />
Nếu  txtDongtienthanhtoan = "VND" thì  txtSotiencanthanhtoanUSD = 0<br />
Nếu txtDongtienthanhtoan = "VND" và txtTamung = “Da thanh toan” và txtThanhtoanL1 = “Da thanh toan” và txtThanhtoanL2 = “Da thanh toan” và txtThanhtoanL3 = “Da thanh toan” thì  txtSotiencanthanhtoanVND = 0<br />
Nếu txtDongtienthanhtoan = "VND" và txtTamung = “Da thanh toan” và txtThanhtoanL1 = “Da thanh toan” và txtThanhtoanL2 = “Da thanh toan” và txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then<br />
    txtSotiencanthanhtoanVND = txtSotienthanhtoanL3VND<br />
...... cư lần lượt như vậy. Mình đã viết đoạn mã VBA sau mà không tính được, nhờ anh chị em xem giúp<br />
<br />
Private Sub cboxVAT_TU_Click()<br />
<div style="text-align: left;" class="mycode_align">If txtDongtienthanhtoan = "VND" And cboxVAT_TU = True Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungVND = txtTonggiatriPOcoVAT * txtGiatriphantramtamung</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungUSD = 0</div>
<div style="text-align: left;" class="mycode_align">    ElseIf txtDongtienthanhtoan = "VND" And cboxVAT_TU = False Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungVND = txtGiatriPO * txtGiatriphantramtamung</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungUSD  = 0</div>
<div style="text-align: left;" class="mycode_align">Else</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And cboxVAT_TU = True Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungUSD  = txtTonggiatriPOcoVAT * txtGiatriphantramtamung</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungVND = 0</div>
<div style="text-align: left;" class="mycode_align">    ElseIf txtDongtienthanhtoan &lt;&gt; "VND" And cboxVAT_TU = False Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungUSD  = txtGiatriPO * txtGiatriphantramtamung</div>
<div style="text-align: left;" class="mycode_align">    txtSotientamungVND = 0</div>
<div style="text-align: left;" class="mycode_align">End If</div>
<div style="text-align: left;" class="mycode_align"> </div>
<div style="text-align: left;" class="mycode_align">If txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = 0</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotientamungVND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotientamungVND + txtSotienthanhtoanL1VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotientamungVND + txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotientamungVND + txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan = "VND" And txtDongtienthanhtoan = "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanVND = txtSotienthanhtoanL1VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = 0</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 = “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotientamungVND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotientamungVND + txtSotienthanhtoanL1VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotientamungVND + txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung &lt;&gt; “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotientamungVND + txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 &lt;&gt; “Da thanh toan” And txtThanhtoanL3 = “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotienthanhtoanL1VND + txtSotienthanhtoanL2VND</div>
<div style="text-align: left;" class="mycode_align">    End If</div>
<div style="text-align: left;" class="mycode_align">    If txtDongtienthanhtoan &lt;&gt; "VND" And txtTamung = “Da thanh toan” And txtThanhtoanL1 &lt;&gt; “Da thanh toan” And txtThanhtoanL2 = “Da thanh toan” And txtThanhtoanL3 &lt;&gt; “Da thanh toan” Then</div>
<div style="text-align: left;" class="mycode_align">    txtSotiencanthanhtoanUSD = txtSotienthanhtoanL1VND + txtSotienthanhtoanL3VND</div>
<div style="text-align: left;" class="mycode_align">End If</div>
<div style="text-align: left;" class="mycode_align">End If</div>
<div style="text-align: left;" class="mycode_align"> </div>
End Sub]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Nhờ các bạn hỗ trợ]]></title>
			<link>https://thuthuataccess.com/forum/thread-12603.html</link>
			<pubDate>Mon, 17 Apr 2023 13:36:39 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=15953">tranthanhan1962</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12603.html</guid>
			<description><![CDATA[Gia cảnh gặp nạn nhờ anh em cứu giúp. Mình đang chuẩn bị viết phần mềm cho anh bạn thì bị nạn. Không hiểu sao cả 2 cái ổ cứng toang một lượt trong đó có cái ổ 2TB lưu toàn bộ các phần mềm code kiết các kiểu cả đời mình gom góp. Giờ mình như cháy nhà chỉ còn 2 bàn tay trắng. Cái ổ 2TB samsung này còn bảo hành mới tức chứ (tất nhiên là nhà bán cũng đưa lại cho mình cái ổ 2T khác nhưng used space =0 GB). Kiểu này chắc nhớ cái gì thì làm cái đó còn thì chắc phải nhờ anh em dài dài. chứ mọi bí kiếp đã trở thành hư vô.<br />
Trước mắt mở database tạo cái table userlogin. Nhớ lại đ/c Mai Định Dân có skill login phân quyền nên nhờ bạn ấy giúp gởi cái demo cho mình trước. (thank Dân trước nhé). Viết xong phần này chắc mình còn nhờ anh em dài dài, Các đ/c: Noname, Xuân Thanh, cpucloi, Minh Tiên, ledangvan... mình cám ơn trước. (Dân nếu gửi link cho mình thì gmail của mình là tranthanhan1962@gmail.com thank you)]]></description>
			<content:encoded><![CDATA[Gia cảnh gặp nạn nhờ anh em cứu giúp. Mình đang chuẩn bị viết phần mềm cho anh bạn thì bị nạn. Không hiểu sao cả 2 cái ổ cứng toang một lượt trong đó có cái ổ 2TB lưu toàn bộ các phần mềm code kiết các kiểu cả đời mình gom góp. Giờ mình như cháy nhà chỉ còn 2 bàn tay trắng. Cái ổ 2TB samsung này còn bảo hành mới tức chứ (tất nhiên là nhà bán cũng đưa lại cho mình cái ổ 2T khác nhưng used space =0 GB). Kiểu này chắc nhớ cái gì thì làm cái đó còn thì chắc phải nhờ anh em dài dài. chứ mọi bí kiếp đã trở thành hư vô.<br />
Trước mắt mở database tạo cái table userlogin. Nhớ lại đ/c Mai Định Dân có skill login phân quyền nên nhờ bạn ấy giúp gởi cái demo cho mình trước. (thank Dân trước nhé). Viết xong phần này chắc mình còn nhờ anh em dài dài, Các đ/c: Noname, Xuân Thanh, cpucloi, Minh Tiên, ledangvan... mình cám ơn trước. (Dân nếu gửi link cho mình thì gmail của mình là tranthanhan1962@gmail.com thank you)]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Lỗi OLE Server or ActiveX Control]]></title>
			<link>https://thuthuataccess.com/forum/thread-12598.html</link>
			<pubDate>Thu, 13 Apr 2023 07:12:39 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=13076">huuduy.duy</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12598.html</guid>
			<description><![CDATA[Chào các anh chị<br />
Em có tải 1 file trên mạng (<a href="https://www.access-programmers.co.uk/forums/threads/report-from-dynamic-crosstab-query-help-on-column-heading.325426/page-2" target="_blank" rel="noopener" class="mycode_url">Link bài viết</a>) về để tìm hiểu, nhưng khi mở lên thì báo lỗi như ảnh.<br />
Nhờ các anh chị hướng dẫn khác phục<br />
Trân trọng cảm ơn<br />
<a href="http://www.mediafire.com/file/qypsk99dgb77h3o/TEFKK%282%293.accdb" target="_blank" rel="noopener" class="mycode_url">http://www.mediafire.com/file/qypsk99dgb...%293.accdb</a><br />
<img src="https://i.upanh.org/2023/04/13/Screenshot-2023-04-13-140119591339694ce1e032.png" loading="lazy"  alt="[Hình: Screenshot-2023-04-13-140119591339694ce1e032.png]" class="mycode_img" />]]></description>
			<content:encoded><![CDATA[Chào các anh chị<br />
Em có tải 1 file trên mạng (<a href="https://www.access-programmers.co.uk/forums/threads/report-from-dynamic-crosstab-query-help-on-column-heading.325426/page-2" target="_blank" rel="noopener" class="mycode_url">Link bài viết</a>) về để tìm hiểu, nhưng khi mở lên thì báo lỗi như ảnh.<br />
Nhờ các anh chị hướng dẫn khác phục<br />
Trân trọng cảm ơn<br />
<a href="http://www.mediafire.com/file/qypsk99dgb77h3o/TEFKK%282%293.accdb" target="_blank" rel="noopener" class="mycode_url">http://www.mediafire.com/file/qypsk99dgb...%293.accdb</a><br />
<img src="https://i.upanh.org/2023/04/13/Screenshot-2023-04-13-140119591339694ce1e032.png" loading="lazy"  alt="[Hình: Screenshot-2023-04-13-140119591339694ce1e032.png]" class="mycode_img" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Câu lệnh SQL không chạy khi thay giá trị bằng ô được đặt tên sẵn]]></title>
			<link>https://thuthuataccess.com/forum/thread-12581.html</link>
			<pubDate>Sat, 25 Mar 2023 14:59:36 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=18669">Đình Phán</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12581.html</guid>
			<description><![CDATA[Chào các anh, chị.<br />
<br />
<div class="codeblock"><div class="title">Mã:</div><div class="body" dir="ltr"><code>Public Sub Search_Debit()<br />
<br />
<br />
Dim MyCnn As Object<br />
Dim MyRs As Object<br />
Dim MySQL As String<br />
<br />
Application.ScreenUpdating = False<br />
    <br />
Set MyCnn = CreateObject("ADODB.Connection")<br />
Set MyRs = CreateObject("ADODB.Recordset")<br />
    'ConnectionString Excel *xlsb<br />
    'Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:&#92;myFolder&#92;myBinaryExcel2007file.xlsb;Extended Properties="Excel 12.0;HDR=YES";<br />
MyCnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" &amp; ThisWorkbook.FullName &amp; ";Extended Properties=""Excel 12.0;HDR=YES"";"<br />
<br />
'MySQL = "SELECT [Ngay_Thang],[So_Tien],[Dien_Giai] FROM [Debit&#36;A:E] WHERE ((([Tai_Khoan] like " &amp; [Account] &amp; ") AND ([Ma_Doi_Tuong] like ""B"") AND ([Ngay_Thang] BETWEEN #" &amp; [Date_1] &amp; "# AND #" &amp; [Date_2] &amp; "#)));"<br />
<br />
MySQL = "SELECT [Ngay_Thang],[So_Tien],[Dien_Giai] FROM [Debit&#36;A:E] WHERE ((([Tai_Khoan] like " &amp; [Account] &amp; ") AND ([Ma_Doi_Tuong] like " &amp; [MET] &amp; ") AND ([Ngay_Thang] BETWEEN #" &amp; [Date_1] &amp; "# AND #" &amp; [Date_2] &amp; "#)));"<br />
<br />
MyRs.Open MySQL, MyCnn<br />
Sheets("Search").Range("A9:E1000").ClearContents<br />
Sheets("Search").Range("B9").CopyFromRecordset MyRs<br />
<br />
MyCnn.Close<br />
Set MyRs = Nothing<br />
Set MyCnn = Nothing<br />
<br />
Application.ScreenUpdating = True<br />
<br />
End Sub</code></div></div><br />
<br />
Em có thực hiện kết nối đến excel và gọi dữ liệu từ 1 sheet, các biến em đã đặt tên, tuy nhiên với Biến Đối tượng, khi thay bằng giá trị đặt tên thì báo lỗi, em ko tìm ra lỗi ở đâu.<br />
Với đợn MySQL ở trên thì chạy được, giờ em muốn giá trị ô đó động nên có đặt tên là MET, nhưng thay vào thành MySQL bên dưới thì lỗi.<br />
Mong các anh, chị trợ giúp<br />
<br />
em cảm ơn.]]></description>
			<content:encoded><![CDATA[Chào các anh, chị.<br />
<br />
<div class="codeblock"><div class="title">Mã:</div><div class="body" dir="ltr"><code>Public Sub Search_Debit()<br />
<br />
<br />
Dim MyCnn As Object<br />
Dim MyRs As Object<br />
Dim MySQL As String<br />
<br />
Application.ScreenUpdating = False<br />
    <br />
Set MyCnn = CreateObject("ADODB.Connection")<br />
Set MyRs = CreateObject("ADODB.Recordset")<br />
    'ConnectionString Excel *xlsb<br />
    'Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:&#92;myFolder&#92;myBinaryExcel2007file.xlsb;Extended Properties="Excel 12.0;HDR=YES";<br />
MyCnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" &amp; ThisWorkbook.FullName &amp; ";Extended Properties=""Excel 12.0;HDR=YES"";"<br />
<br />
'MySQL = "SELECT [Ngay_Thang],[So_Tien],[Dien_Giai] FROM [Debit&#36;A:E] WHERE ((([Tai_Khoan] like " &amp; [Account] &amp; ") AND ([Ma_Doi_Tuong] like ""B"") AND ([Ngay_Thang] BETWEEN #" &amp; [Date_1] &amp; "# AND #" &amp; [Date_2] &amp; "#)));"<br />
<br />
MySQL = "SELECT [Ngay_Thang],[So_Tien],[Dien_Giai] FROM [Debit&#36;A:E] WHERE ((([Tai_Khoan] like " &amp; [Account] &amp; ") AND ([Ma_Doi_Tuong] like " &amp; [MET] &amp; ") AND ([Ngay_Thang] BETWEEN #" &amp; [Date_1] &amp; "# AND #" &amp; [Date_2] &amp; "#)));"<br />
<br />
MyRs.Open MySQL, MyCnn<br />
Sheets("Search").Range("A9:E1000").ClearContents<br />
Sheets("Search").Range("B9").CopyFromRecordset MyRs<br />
<br />
MyCnn.Close<br />
Set MyRs = Nothing<br />
Set MyCnn = Nothing<br />
<br />
Application.ScreenUpdating = True<br />
<br />
End Sub</code></div></div><br />
<br />
Em có thực hiện kết nối đến excel và gọi dữ liệu từ 1 sheet, các biến em đã đặt tên, tuy nhiên với Biến Đối tượng, khi thay bằng giá trị đặt tên thì báo lỗi, em ko tìm ra lỗi ở đâu.<br />
Với đợn MySQL ở trên thì chạy được, giờ em muốn giá trị ô đó động nên có đặt tên là MET, nhưng thay vào thành MySQL bên dưới thì lỗi.<br />
Mong các anh, chị trợ giúp<br />
<br />
em cảm ơn.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Lấy dữ liệu nhập vào Textbox/Combobox để setRowsource ListBox]]></title>
			<link>https://thuthuataccess.com/forum/thread-12549.html</link>
			<pubDate>Sun, 08 Jan 2023 04:53:34 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=10002">Minh Tiên</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12549.html</guid>
			<description><![CDATA[Xin chào cả nhà !<br />
Tiên có 1 "mong muốn": Khi rõ 1 ký tự vào 1 TextBox hoặc Combobox thì sẽ lấy ngay giá trị của TextBox/Combobox này để tham chiếu cho sql nạp Rowsource cho 1 Listbox trên cùng form.<br />
Tiên dùng lệnh Me!Textbox.Text để lấy, nhưng lệnh này lúc chạy đc, lúc báo lỗi 2185. Tiên đã search trên Net vẫn chưa tìm rà cách giải quyết. Nhờ ACE nghiên cứu có cách nào giải quyết được "mong muốn" trên ko ?<br />
Cảm ơn cả nhà !]]></description>
			<content:encoded><![CDATA[Xin chào cả nhà !<br />
Tiên có 1 "mong muốn": Khi rõ 1 ký tự vào 1 TextBox hoặc Combobox thì sẽ lấy ngay giá trị của TextBox/Combobox này để tham chiếu cho sql nạp Rowsource cho 1 Listbox trên cùng form.<br />
Tiên dùng lệnh Me!Textbox.Text để lấy, nhưng lệnh này lúc chạy đc, lúc báo lỗi 2185. Tiên đã search trên Net vẫn chưa tìm rà cách giải quyết. Nhờ ACE nghiên cứu có cách nào giải quyết được "mong muốn" trên ko ?<br />
Cảm ơn cả nhà !]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Nối dữ liệu từ nhiều file excell có cùng field]]></title>
			<link>https://thuthuataccess.com/forum/thread-12439.html</link>
			<pubDate>Mon, 13 Jun 2022 14:48:20 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=21832">family</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12439.html</guid>
			<description><![CDATA[Dạ, em có dữ liệu nhiều file excell cố định các field như thế này, cần nối thành 1 file và group lại theo nhóm Item Code<br />
Nhờ các bậc tiền bối hướng dẫn giúp em với ạ.<br />
<a href="https://drive.google.com/drive/folders/1AJtQJxNsT8MMpVOoPdmrpG8Q5ZjpSLgN?usp=sharing" target="_blank" rel="noopener" class="mycode_url">https://drive.google.com/drive/folders/1...sp=sharing</a>]]></description>
			<content:encoded><![CDATA[Dạ, em có dữ liệu nhiều file excell cố định các field như thế này, cần nối thành 1 file và group lại theo nhóm Item Code<br />
Nhờ các bậc tiền bối hướng dẫn giúp em với ạ.<br />
<a href="https://drive.google.com/drive/folders/1AJtQJxNsT8MMpVOoPdmrpG8Q5ZjpSLgN?usp=sharing" target="_blank" rel="noopener" class="mycode_url">https://drive.google.com/drive/folders/1...sp=sharing</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Câu lệnh kiểm tra các giá trị tại Form không được trống]]></title>
			<link>https://thuthuataccess.com/forum/thread-12437.html</link>
			<pubDate>Fri, 10 Jun 2022 01:45:55 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=18669">Đình Phán</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12437.html</guid>
			<description><![CDATA[Chào các anh,<br />
<br />
Em có vấn đề này mong các anh giúp.<br />
<br />
1. Em muốn viết 1 đoạn VBA để kiểm tra các textbox trong form Header đã được nhập hay chưa. Nếu chưa nhập thì thoát Thủ tục<br />
2. Chạy 1 thủ tục khác, để nhập số liệu vào sub form , lấy giá trị đang có tại 1 textbox của form Header để gán vào sub form<br />
<br />
Em cảm ơn.<br />
<br />
Private Sub Command57_Click()<br />
    If [Forms]![fmTraHeader]![Ma_Phieu_Tra].Value = "" Then<br />
        MsgBox "Ban chua nhap Ma Phieu Tra", vbOKOnly, "Thong bao"<br />
        Exit Sub<br />
    Else<br />
        DoCmd.OpenForm "fmTTPhieuMuon1", acViewNormal<br />
    End If<br />
End Sub]]></description>
			<content:encoded><![CDATA[Chào các anh,<br />
<br />
Em có vấn đề này mong các anh giúp.<br />
<br />
1. Em muốn viết 1 đoạn VBA để kiểm tra các textbox trong form Header đã được nhập hay chưa. Nếu chưa nhập thì thoát Thủ tục<br />
2. Chạy 1 thủ tục khác, để nhập số liệu vào sub form , lấy giá trị đang có tại 1 textbox của form Header để gán vào sub form<br />
<br />
Em cảm ơn.<br />
<br />
Private Sub Command57_Click()<br />
    If [Forms]![fmTraHeader]![Ma_Phieu_Tra].Value = "" Then<br />
        MsgBox "Ban chua nhap Ma Phieu Tra", vbOKOnly, "Thong bao"<br />
        Exit Sub<br />
    Else<br />
        DoCmd.OpenForm "fmTTPhieuMuon1", acViewNormal<br />
    End If<br />
End Sub]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Xin hướng dẫn cách tạo pass cho file access bằng VBA]]></title>
			<link>https://thuthuataccess.com/forum/thread-12435.html</link>
			<pubDate>Wed, 08 Jun 2022 05:08:57 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=18245">doandinhtam</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12435.html</guid>
			<description><![CDATA[Mình có 1 câu hỏi xin được anh em hướng dẫn vì mình cũng không phải dân rành VBA. Giờ mình có 1 file access, thay vì tạo pass bảo vệ thủ công, có cách nào thay đổi tạo pass bằng VBA không? và nếu được thì có cách nào tạo 1 form để thay đổi pass khi cần không? Mình cảm ơn. Anh em hướng dẫn cho mình code với ạ]]></description>
			<content:encoded><![CDATA[Mình có 1 câu hỏi xin được anh em hướng dẫn vì mình cũng không phải dân rành VBA. Giờ mình có 1 file access, thay vì tạo pass bảo vệ thủ công, có cách nào thay đổi tạo pass bằng VBA không? và nếu được thì có cách nào tạo 1 form để thay đổi pass khi cần không? Mình cảm ơn. Anh em hướng dẫn cho mình code với ạ]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Xuất giá trị 2 field trong 1 Query ra Msgbox (thông báo)]]></title>
			<link>https://thuthuataccess.com/forum/thread-12432.html</link>
			<pubDate>Fri, 03 Jun 2022 10:14:46 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://thuthuataccess.com/forum/member.php?action=profile&uid=18669">Đình Phán</a>]]></dc:creator>
			<guid isPermaLink="false">https://thuthuataccess.com/forum/thread-12432.html</guid>
			<description><![CDATA[Chào các anh, chị trong diễn đàn.<br />
<br />
Hiện em có làm 1 query để xuất ra 2 cột, là các giá trị có tại bảng A nhưng không có tại bảng B<br />
Giờ em muốn gán lần lượt các giá trị đó là Msgbox.<br />
Tức là sẽ hiện ra màn hình thông báo rằng các giá trị này không có trong bảng B<br />
<br />
Ví dụ như trong excel thì dễ, em có thể gán từng giá trị của range (dùng vòng lặp) ra Msgbox được.<br />
Nhưng với Recordset trong Access thì em còn mông lung quá.<br />
<br />
Mong các anh, chị giúp đỡ. Cảm ơn!]]></description>
			<content:encoded><![CDATA[Chào các anh, chị trong diễn đàn.<br />
<br />
Hiện em có làm 1 query để xuất ra 2 cột, là các giá trị có tại bảng A nhưng không có tại bảng B<br />
Giờ em muốn gán lần lượt các giá trị đó là Msgbox.<br />
Tức là sẽ hiện ra màn hình thông báo rằng các giá trị này không có trong bảng B<br />
<br />
Ví dụ như trong excel thì dễ, em có thể gán từng giá trị của range (dùng vòng lặp) ra Msgbox được.<br />
Nhưng với Recordset trong Access thì em còn mông lung quá.<br />
<br />
Mong các anh, chị giúp đỡ. Cảm ơn!]]></content:encoded>
		</item>
	</channel>
</rss>