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

เริ่มโดย ingfahm59, 15 พ.ค. 23 , 09:04:33

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

ingfahm59



หากต้องการอ้างอิงเงื่อนไขจาก 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")


  •  

OddyWriter

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

nonc31

ใช้ Not in โค๊ดก็สั้นลงได้นิดนึง
=IIf([txtresident]=[tb_resident] And [txtresident] Not In("1","4","16","19","2","20","24","25","26","27"),"Individual","Archrive")
  •