text box ขึ้นข้อความตามเงื่อนไขหลายเงื่อนไข


0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

15 พ.ค. 66 , 09:04:33
อ่าน 255 ครั้ง

ingfahm59

  • สมาชิกไท.Access
  • กระทู้: 29

    • ดูรายละเอียด



หากต้องการอ้างอิงเงื่อนไขจาก txtresident และ txtpathologist
เช่น หาก txtresident = A,B,C และ txtpathologist = D,E,F ให้ textbox ขึ้นข้อความที่กำหนดค่ะ
เบื้องต้นสามารถเขียน ใน Control Source ได้ดังนี้

=IIf([txtresident]=[tb_resident] And [txtresident]<>"1" And [txtresident]<>"4" And [txtresident]<>"16" And [txtresident]<>"19" And [txtresident]<>"2" And [txtresident]<>"20" And [txtresident]<>"24" And [txtresident]<>"25" And [txtresident]<>"26" And [txtresident]<>"27","Individual","Archrive")



 

15 พ.ค. 66 , 19:55:46
ตอบกลับ #1

OddyWriter

: text box ขึ้นข้อความตามเงื่อนไขหลายเงื่อนไข
« ตอบกลับ #1 เมื่อ: 15 พ.ค. 66 , 19:55:46 »
ใช้ Choose หรือ switch ดีกว่ามั๊งครับ

รับจ้างทำฐานข้อมูล สอนวางระบบฐานข้อมูล Excel/ Access/ VBA Excel/ VBA Access/ SQL Server/ Database Design
แม้กระทั่งดูดวง ก็ติดต่อได้นะครับ
 

17 พ.ค. 66 , 23:53:25
ตอบกลับ #2

nonc31

: text box ขึ้นข้อความตามเงื่อนไขหลายเงื่อนไข
« ตอบกลับ #2 เมื่อ: 17 พ.ค. 66 , 23:53:25 »
ใช้ Not in โค๊ดก็สั้นลงได้นิดนึง
=IIf([txtresident]=[tb_resident] And [txtresident] Not In("1","4","16","19","2","20","24","25","26","27"),"Individual","Archrive")

 


บอร์ดเรียนรู้ Access สำหรับคนไทย


 

Sitemap 1 2 3 4 5