<?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[Access SQL - MS ACCESS ile KOD YAZMAK]]></title>
		<link>https://www.access-sql.com/</link>
		<description><![CDATA[Access SQL - https://www.access-sql.com]]></description>
		<pubDate>Fri, 29 May 2026 16:38:24 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Programlamada İsimlendirme Standartları --- Alan/Nesne/Değişken İsimleri Nasıl Olmalı ?]]></title>
			<link>https://www.access-sql.com/Konu-Programlamada-Isimlendirme-Standartlari-Alan-Nesne-Degisken-Isimleri-Nasil-Olmali</link>
			<pubDate>Fri, 11 May 2012 07:58:14 +0300</pubDate>
			<guid isPermaLink="false">https://www.access-sql.com/Konu-Programlamada-Isimlendirme-Standartlari-Alan-Nesne-Degisken-Isimleri-Nasil-Olmali</guid>
			<description><![CDATA[Merhaba Değerli Dostlar,<br />
<br />
Bu konumuzda sizlere elimden geldiğince isimlendirme standartlarından bahsedeceğim. İsimlendirme hazırlayacağınız uygulamanın hazırlanış zamanını direk etkileyen önemli bir unsurdur. Yanlış isimlendirmeler programınızın kullanım alanını daraltacağı gibi bazı durumlarda meydana gelmiş bir hatanın saatlerce sebebini aramanıza da sebep olabilmektedir.  İsimlendirme belli bir standarda göre yapılırsa uygulamanızın kod sayfasında, ve sorgu tasarımlarınızda bir hayli zaman kazanmanız mümkündür. İsimlendirmeyi standart bir hale getirmenin diğer bir avantajı da uygulamanızın gelişimine katkı sağlayacak kişilerin uygulamayı daha rahat analiz etmesine olanak sağlayacak olmasıdır. <br />
<br />
Şimdi gelin ilk olarak “İsimlendirmede nelere dikkat etmeliyiz? Sorusuna cevap arayalım…<br />
<br />
<span style="font-weight: bold;" class="mycode_b">1.  Asla Boşluk ve Özel Karakter Kullanmayınız</span><br />
<br />
Program tasarımlarınızda ne kod sayfasında ne tablo, form, sorgu, rapor adlarınızda ne de tablolarınızdaki alan adlarında asla boşluk ve özel karakter kullanmayın! Bu durum hem sorgularınızda (SQL) hem de kod sayfasında (VBA) sorun yaşamanıza sebep olacaktır. Özel karakterler : / \ | @ £ ^ ( ) [ ] { } ; : ! # &amp; = * + - ? " ' &#36; %<br />
<br />
Bu konuda özellikle tablo alanlarını isimlendirirken boşluk kullanmaktayız. Fakat buna kesinlikle gerek yok. Her bir alan için resim yazısı (caption) belirleyebiliriz. Belirlediğimiz bu değerler bir nev’i başlık işlevi görmektedir. Tablo, form ve raporlarımızda belirlediğimiz bu değerler görünmektedir. Eğer değer belirlemezsek bu durumda alan ismi görünmektedir. Lütfen bu konuya özellikle dikkat edelim…<br />
<br />
<span style="font-weight: bold;" class="mycode_b">2. Access ve SQL Tarafından Kullanılan Kelimeleri Kullanmayınız</span><br />
<br />
Bu konuda pek sıkıntı olduğunu sanmıyorum. Herhalde aramızda “select” ya da “string” diye isim veren yoktur <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /> <br />
<span style="font-weight: bold;" class="mycode_b"><br />
3.İsimlendirmeyi Mümkün Olduğu Kadar Kısa ve Bilgilendirici Yapın </span><br />
<br />
İsimlendirme yaparken cümle oluşturmaya çalışmayalım. Yoksa oluşturduğunuz bu cümleyi bir çok yerde tekrar yazmak zorunda kalırız <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /> İsimlendirme çok kısa da olmamalı. “a”,”b” gibi isimlendirme yapmaktan kaçınalım. 3 gün sonra bu a da neydi? diye sormayalım…<br />
<span style="color: #FF0000;" class="mycode_color">tblSatınAlmaDepartmanıIcinSiparisTablosu</span> yerine <br />
<span style="color: #006400;" class="mycode_color">tblSiparis</span> yazmak çok daha mantıklıdır. <br />
<span style="font-weight: bold;" class="mycode_b"><br />
4.İsimlendirmede Deve Notasyonu (Camel Case) </span><br />
<br />
Şahsen tercih ettiğim isimlendirme yöntemidir. Bu yapıda ilk kelime tamamen küçük harf yazılır. İlk kelimeden sonraki her kelimenin sadece baş harfi büyük yazılır. Örnek verecek olursak…<br />
<br />
<span style="font-weight: bold;" class="mycode_b">srgBugunOdemesiOlanlar<br />
mdlFormuller<br />
tblMusteri</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">5. İsimlendirmede Öntakı Kullanın</span><br />
 <br />
Aşağıdaki liste programlarınızda kullanacağınız nesneler için öntakı örneklerini göstermektedir. Öntakı kullanırsanız nesneler arasında hızlı bir ayrım yapabilirsiniz. Aksi takdirde kafanız biraz karışabilir. Düşünsenize Müşteri adlı bir tablonuz, bir formunuz, bir raporunuz ve bir de sorgunuz olduğunu… Olması gereken: <span style="font-weight: bold;" class="mycode_b">tblMusteri, frmMusteri, rprMusteri,srgMusteri…<br />
</span><br />
<br />
Öntakı kullanımının bir önemi de sorgu tasarımında ortaya çıkmakadır. Eğer öntakı kullanmamışsanız sorgu tasarım ekranından çekeceğiniz var… <img src="https://www.access-sql.com/images/smilies/trz2/smile.gif" alt="Smile" title="Smile" class="smilie smilie_78" /><br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Nesnelerde Öntakı: </span><br />
<br />
Tablolar : <span style="font-style: italic;" class="mycode_i">tbl   </span>--------------&gt; <span style="font-weight: bold;" class="mycode_b">tblMusteri, tblSiparis, tblOgrenci</span><br />
Sorgular: <span style="font-style: italic;" class="mycode_i">srg</span>-----------------&gt;<span style="font-weight: bold;" class="mycode_b">srgAnaliz, srgOgrenci</span><br />
Formlar: <span style="font-style: italic;" class="mycode_i">frm</span>-----------------&gt;<span style="font-weight: bold;" class="mycode_b">frmAna,frmAnaliz</span><br />
Raporlar: <span style="font-style: italic;" class="mycode_i">rpr</span><br />
Makrolar: <span style="font-style: italic;" class="mycode_i">mkr</span><br />
Modüller: <span style="font-style: italic;" class="mycode_i">mdl</span><br />
<br />
Eğer bir alt form ya da rapor kullanmışsanız bu durumda ilk öntakı’dan sonra bunu belirtin. Örneğin frmAltFormAdi,rprAltRaporAdi gibi.<br />
<span style="text-decoration: underline;" class="mycode_u"><br />
Form ve Rapor Nesnelerinde Öntakı:</span><br />
<br />
Metin kutusu: <span style="font-style: italic;" class="mycode_i">txt</span>--------&gt; <span style="font-weight: bold;" class="mycode_b">txtMetinAdı</span><br />
Etiket: <span style="font-style: italic;" class="mycode_i">lbl</span>--------&gt;<span style="font-weight: bold;" class="mycode_b">lblEtiketAdi</span><br />
Açılır kutu:<span style="font-style: italic;" class="mycode_i">cmb </span>--------&gt;<span style="font-weight: bold;" class="mycode_b">cmbAcilanKutuAdi</span><br />
Liste kutusu:<span style="font-style: italic;" class="mycode_i">lst </span>---------&gt;<span style="font-weight: bold;" class="mycode_b">lstListeAdi</span><br />
Düğme/Buton:<span style="font-style: italic;" class="mycode_i">btn </span>---------&gt;<span style="font-weight: bold;" class="mycode_b">btnButonAdi</span><br />
Seçenek Grubu: <span style="font-style: italic;" class="mycode_i">opt</span>---------&gt;<span style="font-weight: bold;" class="mycode_b">optGrupAdi</span><br />
Resim: <span style="font-style: italic;" class="mycode_i">img</span>---------&gt;imgResim<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Kod Sayfasında Öntakı:</span><br />
<br />
String: <span style="font-style: italic;" class="mycode_i">str</span><br />
Integer:<span style="font-style: italic;" class="mycode_i">int</span><br />
Double:<span style="font-style: italic;" class="mycode_i">dbl</span><br />
Object:<span style="font-style: italic;" class="mycode_i">obj</span><br />
Aplication:<span style="font-style: italic;" class="mycode_i">app</span><br />
Document:<span style="font-style: italic;" class="mycode_i">doc</span><br />
Recordset:<span style="font-style: italic;" class="mycode_i">rec</span><br />
Field:<span style="font-style: italic;" class="mycode_i">fld</span><br />
Function:<span style="font-style: italic;" class="mycode_i">fnc</span><br />
.<br />
.<br />
.<br />
<br />
Cumanız mübarek, kodunuz keskin olsun <img src="https://www.access-sql.com/images/smilies/trz2/laugh.gif" alt="Laugh" title="Laugh" class="smilie smilie_85" /><br />
]]></description>
			<content:encoded><![CDATA[Merhaba Değerli Dostlar,<br />
<br />
Bu konumuzda sizlere elimden geldiğince isimlendirme standartlarından bahsedeceğim. İsimlendirme hazırlayacağınız uygulamanın hazırlanış zamanını direk etkileyen önemli bir unsurdur. Yanlış isimlendirmeler programınızın kullanım alanını daraltacağı gibi bazı durumlarda meydana gelmiş bir hatanın saatlerce sebebini aramanıza da sebep olabilmektedir.  İsimlendirme belli bir standarda göre yapılırsa uygulamanızın kod sayfasında, ve sorgu tasarımlarınızda bir hayli zaman kazanmanız mümkündür. İsimlendirmeyi standart bir hale getirmenin diğer bir avantajı da uygulamanızın gelişimine katkı sağlayacak kişilerin uygulamayı daha rahat analiz etmesine olanak sağlayacak olmasıdır. <br />
<br />
Şimdi gelin ilk olarak “İsimlendirmede nelere dikkat etmeliyiz? Sorusuna cevap arayalım…<br />
<br />
<span style="font-weight: bold;" class="mycode_b">1.  Asla Boşluk ve Özel Karakter Kullanmayınız</span><br />
<br />
Program tasarımlarınızda ne kod sayfasında ne tablo, form, sorgu, rapor adlarınızda ne de tablolarınızdaki alan adlarında asla boşluk ve özel karakter kullanmayın! Bu durum hem sorgularınızda (SQL) hem de kod sayfasında (VBA) sorun yaşamanıza sebep olacaktır. Özel karakterler : / \ | @ £ ^ ( ) [ ] { } ; : ! # &amp; = * + - ? " ' &#36; %<br />
<br />
Bu konuda özellikle tablo alanlarını isimlendirirken boşluk kullanmaktayız. Fakat buna kesinlikle gerek yok. Her bir alan için resim yazısı (caption) belirleyebiliriz. Belirlediğimiz bu değerler bir nev’i başlık işlevi görmektedir. Tablo, form ve raporlarımızda belirlediğimiz bu değerler görünmektedir. Eğer değer belirlemezsek bu durumda alan ismi görünmektedir. Lütfen bu konuya özellikle dikkat edelim…<br />
<br />
<span style="font-weight: bold;" class="mycode_b">2. Access ve SQL Tarafından Kullanılan Kelimeleri Kullanmayınız</span><br />
<br />
Bu konuda pek sıkıntı olduğunu sanmıyorum. Herhalde aramızda “select” ya da “string” diye isim veren yoktur <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /> <br />
<span style="font-weight: bold;" class="mycode_b"><br />
3.İsimlendirmeyi Mümkün Olduğu Kadar Kısa ve Bilgilendirici Yapın </span><br />
<br />
İsimlendirme yaparken cümle oluşturmaya çalışmayalım. Yoksa oluşturduğunuz bu cümleyi bir çok yerde tekrar yazmak zorunda kalırız <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /> İsimlendirme çok kısa da olmamalı. “a”,”b” gibi isimlendirme yapmaktan kaçınalım. 3 gün sonra bu a da neydi? diye sormayalım…<br />
<span style="color: #FF0000;" class="mycode_color">tblSatınAlmaDepartmanıIcinSiparisTablosu</span> yerine <br />
<span style="color: #006400;" class="mycode_color">tblSiparis</span> yazmak çok daha mantıklıdır. <br />
<span style="font-weight: bold;" class="mycode_b"><br />
4.İsimlendirmede Deve Notasyonu (Camel Case) </span><br />
<br />
Şahsen tercih ettiğim isimlendirme yöntemidir. Bu yapıda ilk kelime tamamen küçük harf yazılır. İlk kelimeden sonraki her kelimenin sadece baş harfi büyük yazılır. Örnek verecek olursak…<br />
<br />
<span style="font-weight: bold;" class="mycode_b">srgBugunOdemesiOlanlar<br />
mdlFormuller<br />
tblMusteri</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">5. İsimlendirmede Öntakı Kullanın</span><br />
 <br />
Aşağıdaki liste programlarınızda kullanacağınız nesneler için öntakı örneklerini göstermektedir. Öntakı kullanırsanız nesneler arasında hızlı bir ayrım yapabilirsiniz. Aksi takdirde kafanız biraz karışabilir. Düşünsenize Müşteri adlı bir tablonuz, bir formunuz, bir raporunuz ve bir de sorgunuz olduğunu… Olması gereken: <span style="font-weight: bold;" class="mycode_b">tblMusteri, frmMusteri, rprMusteri,srgMusteri…<br />
</span><br />
<br />
Öntakı kullanımının bir önemi de sorgu tasarımında ortaya çıkmakadır. Eğer öntakı kullanmamışsanız sorgu tasarım ekranından çekeceğiniz var… <img src="https://www.access-sql.com/images/smilies/trz2/smile.gif" alt="Smile" title="Smile" class="smilie smilie_78" /><br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Nesnelerde Öntakı: </span><br />
<br />
Tablolar : <span style="font-style: italic;" class="mycode_i">tbl   </span>--------------&gt; <span style="font-weight: bold;" class="mycode_b">tblMusteri, tblSiparis, tblOgrenci</span><br />
Sorgular: <span style="font-style: italic;" class="mycode_i">srg</span>-----------------&gt;<span style="font-weight: bold;" class="mycode_b">srgAnaliz, srgOgrenci</span><br />
Formlar: <span style="font-style: italic;" class="mycode_i">frm</span>-----------------&gt;<span style="font-weight: bold;" class="mycode_b">frmAna,frmAnaliz</span><br />
Raporlar: <span style="font-style: italic;" class="mycode_i">rpr</span><br />
Makrolar: <span style="font-style: italic;" class="mycode_i">mkr</span><br />
Modüller: <span style="font-style: italic;" class="mycode_i">mdl</span><br />
<br />
Eğer bir alt form ya da rapor kullanmışsanız bu durumda ilk öntakı’dan sonra bunu belirtin. Örneğin frmAltFormAdi,rprAltRaporAdi gibi.<br />
<span style="text-decoration: underline;" class="mycode_u"><br />
Form ve Rapor Nesnelerinde Öntakı:</span><br />
<br />
Metin kutusu: <span style="font-style: italic;" class="mycode_i">txt</span>--------&gt; <span style="font-weight: bold;" class="mycode_b">txtMetinAdı</span><br />
Etiket: <span style="font-style: italic;" class="mycode_i">lbl</span>--------&gt;<span style="font-weight: bold;" class="mycode_b">lblEtiketAdi</span><br />
Açılır kutu:<span style="font-style: italic;" class="mycode_i">cmb </span>--------&gt;<span style="font-weight: bold;" class="mycode_b">cmbAcilanKutuAdi</span><br />
Liste kutusu:<span style="font-style: italic;" class="mycode_i">lst </span>---------&gt;<span style="font-weight: bold;" class="mycode_b">lstListeAdi</span><br />
Düğme/Buton:<span style="font-style: italic;" class="mycode_i">btn </span>---------&gt;<span style="font-weight: bold;" class="mycode_b">btnButonAdi</span><br />
Seçenek Grubu: <span style="font-style: italic;" class="mycode_i">opt</span>---------&gt;<span style="font-weight: bold;" class="mycode_b">optGrupAdi</span><br />
Resim: <span style="font-style: italic;" class="mycode_i">img</span>---------&gt;imgResim<br />
<br />
<span style="text-decoration: underline;" class="mycode_u">Kod Sayfasında Öntakı:</span><br />
<br />
String: <span style="font-style: italic;" class="mycode_i">str</span><br />
Integer:<span style="font-style: italic;" class="mycode_i">int</span><br />
Double:<span style="font-style: italic;" class="mycode_i">dbl</span><br />
Object:<span style="font-style: italic;" class="mycode_i">obj</span><br />
Aplication:<span style="font-style: italic;" class="mycode_i">app</span><br />
Document:<span style="font-style: italic;" class="mycode_i">doc</span><br />
Recordset:<span style="font-style: italic;" class="mycode_i">rec</span><br />
Field:<span style="font-style: italic;" class="mycode_i">fld</span><br />
Function:<span style="font-style: italic;" class="mycode_i">fnc</span><br />
.<br />
.<br />
.<br />
<br />
Cumanız mübarek, kodunuz keskin olsun <img src="https://www.access-sql.com/images/smilies/trz2/laugh.gif" alt="Laugh" title="Laugh" class="smilie smilie_85" /><br />
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[DÖNGÜLER | FOR - NEXT]]></title>
			<link>https://www.access-sql.com/Konu-DONGULER-FOR-NEXT</link>
			<pubDate>Sun, 22 May 2011 02:03:43 +0300</pubDate>
			<guid isPermaLink="false">https://www.access-sql.com/Konu-DONGULER-FOR-NEXT</guid>
			<description><![CDATA[<span style="font-size: x-small;" class="mycode_size"><span style="color: #696969;" class="mycode_color"><span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">GİRİŞ</span><br />
<br />
Bu kısımda size döngülerden bahsedeceğim.. Döngüler amaç olarak, komutların tekrarlatılmasına yarar.. Bir işlemi birden fazla ve aynı anda yaptırtmak istiyorsak döngü hazırlamalıyız.. <br />
<br />
Döngüleri iki temel başlık altında toplayabiliriz..:<br />
<br />
<ol type="1" class="mycode_list"><li>Sayaçlı Döngüler ( For – Next )<br />
</li>
<li>Koşullu Döngüler ( Do while – Loop, While – End))<br />
</li>
</ol>
<br />
</span></span></span><br />
<br />
Merhaba arkadaşlar..<br />
<br />
Access ile uygulama geliştirirken ihtiyaç duyduğumuz en önemli yapılardandır döngüler.. Döngü hazırlamak zor gibi görünse de temel yapıyı öğrendikten sonra çok kolay ve de keyifli (hele sonucu aldıktan sonra <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /> ) olduğunu keşfedebilirsiniz.. En sık kullanılan döngü tipi de <span style="font-weight: bold;" class="mycode_b">For Next</span> yapısıdır.. <br />
<br />
<span style="font-weight: bold;" class="mycode_b">For Next</span>, bir grup deyimi belirlediğimiz sayıda çalıştırararak, bir döngü oluşturur. <br />
<br />
Yapı bu şekilde..:<br />
<br />
<span style="color: #006400;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">For </span></span></span> <span style="font-size: x-small;" class="mycode_size">Sayaç </span> <span style="color: #8B4513;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">=</span></span> <span style="font-size: x-small;" class="mycode_size">Başlangıç Değeri</span> <span style="color: #0000CD;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">To </span></span></span><span style="font-size: x-small;" class="mycode_size">Bitiş Değeri</span> <br />
<span style="font-style: italic;" class="mycode_i">Komutlar</span><br />
<span style="font-size: large;" class="mycode_size"><span style="color: #800080;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Next </span></span></span><span style="font-size: x-small;" class="mycode_size">Sayaç</span><br />
<br />
Örnekleyelim hemen..<br />
<br />
Formunuzun üzerine, varsayılan değeri 0 (sıfır) olan bir adet metin kutusu (metin1) ve bir komut düğmesi (komut1) yerleştirin.. <br />
Düğmenin tıklandığında olayına bu yapıyı kullanalım şimdi:<br />
<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">For</span> sayac <span style="color: #7B927B;">=</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 3</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1 <span style="color: #7B927B;">=</span> Metin1 <span style="color: #7B927B;">+</span> sayac</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Next</span> sayac</div></li></ol></pre></code></div></div><br /><br />
<br />
Çalıştırdığınızda metin1 kutusunda 6 değerini göreceksiniz..<br />
<br />
Yukarıdaki yapıyı dilimize çevirirsek..:<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin1'deki değere sayaç değerini ekle. Ve bunu 3 sefer yap. Her seferde de sayaç değeri artsın.</span></span><br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><br />
0+1=1<br />
1+2=3<br />
3+3=6<br />
</span></span><br />
<br />
İşlemdeki ilk rakamlar metin1'in aldığı değerler.. Toplanan rakam ise sayaç değeri..<br />
<br />
Üsteki yapıda sayaç her döngüde bir artarak gider.. Bu değer varsayılandır. Ama biz bunu değiştirebiliriz.<br />
<br />
Şimdi komutla diyelim ki: <br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin1'deki değere sayaç değerini ekle. Ama sayaç değeri her seferde dörder artsın. Taa ki sayaç 20 ye gelene kadar..:</span></span><br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">For</span> sayac <span style="color: #7B927B;">=</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 20 <span style="color: #268bd2; font-weight: bold;">Step</span> 4</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1 <span style="color: #7B927B;">=</span> Metin1 <span style="color: #7B927B;">+</span> sayac</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">MsgBox Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Next</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Gördüğünüz gibi Step (adım) kısmında sayaç artışını belirledik..<br />
<br />
Olayın aritmetiği de bu şekilde..:<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">0+1=1<br />
1+5=6<br />
6+9=15<br />
15+13=28<br />
28+17=45</span></span><br />
<br />
Step kısmında -(eksi) değer kullanabiliriz.. Genelde sayaç başlangıç değeri,  bitiş değerinden küçük olmalıdır.. Ama Step değerini eksi vereceksek durum değişir..<br />
<br />
Şimdi döngümüze bir koşul koyalım.. Forma metin1 ile aynı özellikte bir metin kutusu daha yerleştirelim (metin2). <br />
<br />
Yeni döngümüz bu olsun..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">For</span> sayac <span style="color: #7B927B;">=</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 5</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin2 <span style="color: #7B927B;">=</span> 3 <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin1 <span style="color: #7B927B;">=</span> Metin1 <span style="color: #7B927B;">+</span> sayac</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> sayac</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Next</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
Anlamı..:<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin2'deki değere sayaç değerini ekle. Bu işlemi beş defa yap. Her defasında metin2 ye de bak bakalım.. Eğer değeri 3 ise metin1 e sayaç değerini ekle.</span></span><br />
<br />
Gördüğünüz gibi döngü içerisinde koşul kullandık.. Basitçe şema çıkartalım..: <br />
<br />
<img src="http://www.access-sql.com/resim/fornext.jpg" alt="[Resim: fornext.jpg]" class="mycode_img" /><br />
<br />
Bir döngü içerisinde başka bir döngü de çalıştırabiliriz.:<br />
<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">For</span> sayac1 <span style="color: #7B927B;">=</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 3</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1 <span style="color: #7B927B;">=</span> Metin1 <span style="color: #7B927B;">+</span> sayac1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">For</span> sayac2 <span style="color: #7B927B;">=</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 2</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> Metin2 <span style="color: #7B927B;">+</span> sayac2</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Next</span> sayac2</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Next</span> sayac1 'ilk döngünün <span style="color: #268bd2; font-weight: bold;">Next</span> bölümü son bölümde yazılmalıdır<span style="color: #7B927B;">..</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
Yukarıda dedik ki..:<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin1'deki değere sayaç1 değerini ekle. Bu işlemi üç defa yap. Her defasında diğer döngüyü de çalıştır ve sonuçlandır. </span></span><br />
<br />
<br />
<img src="http://www.access-sql.com/resim/fornext2.jpg" alt="[Resim: fornext2.jpg]" class="mycode_img" /><br />
<br />
Birden fazla iç içe döngü kurabilirsiniz..<br />
<br />
Denemeler yaparken yanlışlıkla sonsuz bir döngü kurarsanız sonlandırmak için  <span style="font-weight: bold;" class="mycode_b">CTRL + BREAK </span> tuşlarını kullanın..<br />
<br />
Örneklerde ben toplama işlemlerini kullandım.. Siz buna şartlanmayın.. Döngü içerisinde bir çok komut ve eylem gerçekleştirebilirsiniz.. Bu tamamen ihtiyacınıza bağlı..<br />
<br />
Hazır bu konuya ısınmışken <span style="font-weight: bold;" class="mycode_b">For Next</span>'in kuzeni <span style="font-weight: bold;" class="mycode_b">For Each </span>döngüsünden de bahsetmek lazımdı ama geç oldu.. Daha sonra, farklı bir konuda artık.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Taruz.. 2011</span></span>]]></description>
			<content:encoded><![CDATA[<span style="font-size: x-small;" class="mycode_size"><span style="color: #696969;" class="mycode_color"><span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">GİRİŞ</span><br />
<br />
Bu kısımda size döngülerden bahsedeceğim.. Döngüler amaç olarak, komutların tekrarlatılmasına yarar.. Bir işlemi birden fazla ve aynı anda yaptırtmak istiyorsak döngü hazırlamalıyız.. <br />
<br />
Döngüleri iki temel başlık altında toplayabiliriz..:<br />
<br />
<ol type="1" class="mycode_list"><li>Sayaçlı Döngüler ( For – Next )<br />
</li>
<li>Koşullu Döngüler ( Do while – Loop, While – End))<br />
</li>
</ol>
<br />
</span></span></span><br />
<br />
Merhaba arkadaşlar..<br />
<br />
Access ile uygulama geliştirirken ihtiyaç duyduğumuz en önemli yapılardandır döngüler.. Döngü hazırlamak zor gibi görünse de temel yapıyı öğrendikten sonra çok kolay ve de keyifli (hele sonucu aldıktan sonra <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /> ) olduğunu keşfedebilirsiniz.. En sık kullanılan döngü tipi de <span style="font-weight: bold;" class="mycode_b">For Next</span> yapısıdır.. <br />
<br />
<span style="font-weight: bold;" class="mycode_b">For Next</span>, bir grup deyimi belirlediğimiz sayıda çalıştırararak, bir döngü oluşturur. <br />
<br />
Yapı bu şekilde..:<br />
<br />
<span style="color: #006400;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">For </span></span></span> <span style="font-size: x-small;" class="mycode_size">Sayaç </span> <span style="color: #8B4513;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">=</span></span> <span style="font-size: x-small;" class="mycode_size">Başlangıç Değeri</span> <span style="color: #0000CD;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">To </span></span></span><span style="font-size: x-small;" class="mycode_size">Bitiş Değeri</span> <br />
<span style="font-style: italic;" class="mycode_i">Komutlar</span><br />
<span style="font-size: large;" class="mycode_size"><span style="color: #800080;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Next </span></span></span><span style="font-size: x-small;" class="mycode_size">Sayaç</span><br />
<br />
Örnekleyelim hemen..<br />
<br />
Formunuzun üzerine, varsayılan değeri 0 (sıfır) olan bir adet metin kutusu (metin1) ve bir komut düğmesi (komut1) yerleştirin.. <br />
Düğmenin tıklandığında olayına bu yapıyı kullanalım şimdi:<br />
<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">For</span> sayac <span style="color: #7B927B;">=</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 3</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1 <span style="color: #7B927B;">=</span> Metin1 <span style="color: #7B927B;">+</span> sayac</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Next</span> sayac</div></li></ol></pre></code></div></div><br /><br />
<br />
Çalıştırdığınızda metin1 kutusunda 6 değerini göreceksiniz..<br />
<br />
Yukarıdaki yapıyı dilimize çevirirsek..:<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin1'deki değere sayaç değerini ekle. Ve bunu 3 sefer yap. Her seferde de sayaç değeri artsın.</span></span><br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b"><br />
0+1=1<br />
1+2=3<br />
3+3=6<br />
</span></span><br />
<br />
İşlemdeki ilk rakamlar metin1'in aldığı değerler.. Toplanan rakam ise sayaç değeri..<br />
<br />
Üsteki yapıda sayaç her döngüde bir artarak gider.. Bu değer varsayılandır. Ama biz bunu değiştirebiliriz.<br />
<br />
Şimdi komutla diyelim ki: <br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin1'deki değere sayaç değerini ekle. Ama sayaç değeri her seferde dörder artsın. Taa ki sayaç 20 ye gelene kadar..:</span></span><br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">For</span> sayac <span style="color: #7B927B;">=</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 20 <span style="color: #268bd2; font-weight: bold;">Step</span> 4</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1 <span style="color: #7B927B;">=</span> Metin1 <span style="color: #7B927B;">+</span> sayac</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">MsgBox Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Next</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Gördüğünüz gibi Step (adım) kısmında sayaç artışını belirledik..<br />
<br />
Olayın aritmetiği de bu şekilde..:<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">0+1=1<br />
1+5=6<br />
6+9=15<br />
15+13=28<br />
28+17=45</span></span><br />
<br />
Step kısmında -(eksi) değer kullanabiliriz.. Genelde sayaç başlangıç değeri,  bitiş değerinden küçük olmalıdır.. Ama Step değerini eksi vereceksek durum değişir..<br />
<br />
Şimdi döngümüze bir koşul koyalım.. Forma metin1 ile aynı özellikte bir metin kutusu daha yerleştirelim (metin2). <br />
<br />
Yeni döngümüz bu olsun..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">For</span> sayac <span style="color: #7B927B;">=</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 5</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin2 <span style="color: #7B927B;">=</span> 3 <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin1 <span style="color: #7B927B;">=</span> Metin1 <span style="color: #7B927B;">+</span> sayac</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> sayac</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Next</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
Anlamı..:<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin2'deki değere sayaç değerini ekle. Bu işlemi beş defa yap. Her defasında metin2 ye de bak bakalım.. Eğer değeri 3 ise metin1 e sayaç değerini ekle.</span></span><br />
<br />
Gördüğünüz gibi döngü içerisinde koşul kullandık.. Basitçe şema çıkartalım..: <br />
<br />
<img src="http://www.access-sql.com/resim/fornext.jpg" alt="[Resim: fornext.jpg]" class="mycode_img" /><br />
<br />
Bir döngü içerisinde başka bir döngü de çalıştırabiliriz.:<br />
<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">For</span> sayac1 <span style="color: #7B927B;">=</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 3</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1 <span style="color: #7B927B;">=</span> Metin1 <span style="color: #7B927B;">+</span> sayac1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">For</span> sayac2 <span style="color: #7B927B;">=</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 2</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> Metin2 <span style="color: #7B927B;">+</span> sayac2</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Next</span> sayac2</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Next</span> sayac1 'ilk döngünün <span style="color: #268bd2; font-weight: bold;">Next</span> bölümü son bölümde yazılmalıdır<span style="color: #7B927B;">..</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
Yukarıda dedik ki..:<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin1'deki değere sayaç1 değerini ekle. Bu işlemi üç defa yap. Her defasında diğer döngüyü de çalıştır ve sonuçlandır. </span></span><br />
<br />
<br />
<img src="http://www.access-sql.com/resim/fornext2.jpg" alt="[Resim: fornext2.jpg]" class="mycode_img" /><br />
<br />
Birden fazla iç içe döngü kurabilirsiniz..<br />
<br />
Denemeler yaparken yanlışlıkla sonsuz bir döngü kurarsanız sonlandırmak için  <span style="font-weight: bold;" class="mycode_b">CTRL + BREAK </span> tuşlarını kullanın..<br />
<br />
Örneklerde ben toplama işlemlerini kullandım.. Siz buna şartlanmayın.. Döngü içerisinde bir çok komut ve eylem gerçekleştirebilirsiniz.. Bu tamamen ihtiyacınıza bağlı..<br />
<br />
Hazır bu konuya ısınmışken <span style="font-weight: bold;" class="mycode_b">For Next</span>'in kuzeni <span style="font-weight: bold;" class="mycode_b">For Each </span>döngüsünden de bahsetmek lazımdı ama geç oldu.. Daha sonra, farklı bir konuda artık.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Taruz.. 2011</span></span>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[WITH - END WITH Yapısı]]></title>
			<link>https://www.access-sql.com/Konu-WITH-END-WITH-Yapisi</link>
			<pubDate>Thu, 19 May 2011 19:22:10 +0300</pubDate>
			<guid isPermaLink="false">https://www.access-sql.com/Konu-WITH-END-WITH-Yapisi</guid>
			<description><![CDATA[<span style="font-size: x-small;" class="mycode_size"><span style="color: #696969;" class="mycode_color"><span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">GİRİŞ</span><br />
<br />
Access ile hazırladığımız uygulamalarımızda yapmak istediklerimiz arttıkça artık menülerin, sihirbazların, makroların yetersiz kaldığını hissederiz.. Ama biz uygulamalarımızın daha özgün, esnek ve de kullanışlı olmasını istiyoruz.. Bu da demektir ki artık ufak ufak kod yazmayı öğrenmenin zamanı gelmiştir.. <br />
<br />
</span></span></span><br />
<br />
<br />
Merhaba arkadaşlar..<br />
<br />
<span style="font-weight: bold;" class="mycode_b">With </span>yapısı kısaca, aynı koleksiyona ait komut yapılarını kullanarak hazırladığımız kodları kısaltmamızı sağlar.. Ayrıca bu yapıyı uyguladığımız komutlarımızın daha hızlı çalıştığını göreceksiniz..<br />
<br />
Kullanımı basit ve de karışık kod bloklarımızı sadeleştiren bu yapının uygulanışına bir örnek vereyim..:<br />
<br />
Diyelim ki şöyle bir kod bloğumuz var..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span>Maximize</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span>OpenForm &quot;form1&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span>GoToRecord <span style="color: #7B927B;">,</span> <span style="color: #7B927B;">,</span> acNewRec</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span>GoToControl &quot;metin1&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span>Requery</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span><span style="color: #268bd2; font-weight: bold;">Close</span></div></li></ol></pre></code></div></div><br /><br />
<br />
İnsan, Docmd yazmaktan sivilce çıkartır.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
İşte with burada imdada yetişir ve pürüzsüz bir cilt sağlar.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">With</span> <span style="color: #151B8D; font-weight: bold;">DoCmd</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Maximize</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>OpenForm &quot;form1&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>GoToRecord <span style="color: #7B927B;">,</span> <span style="color: #7B927B;">,</span> acNewRec</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>GoToControl &quot;metin1&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Requery</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span><span style="color: #268bd2; font-weight: bold;">Close</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">With</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
Bu da başka bir örnek..<br />
<br />
<span style="font-weight: bold;" class="mycode_b">With</span> den Önce.. <br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>SetFocus</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>Text <span style="color: #7B927B;">=</span> &quot;<span style="color: #FF0000; font-weight: bold;">trz</span> 2011&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>FontBold <span style="color: #7B927B;">=</span> <span style="color: #718c00; font-weight: bold;">True</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>FontSize <span style="color: #7B927B;">=</span> 25</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>ForeColor <span style="color: #7B927B;">=</span> vbRed</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>Width <span style="color: #7B927B;">=</span> 3000</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>Height <span style="color: #7B927B;">=</span> 500</div></li></ol></pre></code></div></div><br /><br />
<br />
<span style="font-weight: bold;" class="mycode_b">With </span>den Sonra..<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">With</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>SetFocus</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Text <span style="color: #7B927B;">=</span> &quot;<span style="color: #FF0000; font-weight: bold;">trz</span> 2011&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>FontBold <span style="color: #7B927B;">=</span> <span style="color: #718c00; font-weight: bold;">True</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>FontSize <span style="color: #7B927B;">=</span> 25</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>ForeColor <span style="color: #7B927B;">=</span> vbRed</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Width <span style="color: #7B927B;">=</span> 3000</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Height <span style="color: #7B927B;">=</span> 500</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">With</span></div></li></ol></pre></code></div></div><br /><br />
<br />
With esnektir.. İçerisinde karar yapıları da kullanabiliriz.. İf Then Else ile bir örnek..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">With</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>SetFocus</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Text <span style="color: #7B927B;">=</span> &quot;<span style="color: #FF0000; font-weight: bold;">trz</span> 2011&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>FontBold <span style="color: #7B927B;">=</span> <span style="color: #718c00; font-weight: bold;">True</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">If</span> Metin2 <span style="color: #7B927B;">=</span> &quot;büyük&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #7B927B;">.</span>FontSize <span style="color: #7B927B;">=</span> 25</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #7B927B;">.</span>FontSize <span style="color: #7B927B;">=</span> 12</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>ForeColor <span style="color: #7B927B;">=</span> vbRed</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Width <span style="color: #7B927B;">=</span> 3000</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Height <span style="color: #7B927B;">=</span> 500</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">With</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Taruz... 2011</span></span></span>]]></description>
			<content:encoded><![CDATA[<span style="font-size: x-small;" class="mycode_size"><span style="color: #696969;" class="mycode_color"><span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">GİRİŞ</span><br />
<br />
Access ile hazırladığımız uygulamalarımızda yapmak istediklerimiz arttıkça artık menülerin, sihirbazların, makroların yetersiz kaldığını hissederiz.. Ama biz uygulamalarımızın daha özgün, esnek ve de kullanışlı olmasını istiyoruz.. Bu da demektir ki artık ufak ufak kod yazmayı öğrenmenin zamanı gelmiştir.. <br />
<br />
</span></span></span><br />
<br />
<br />
Merhaba arkadaşlar..<br />
<br />
<span style="font-weight: bold;" class="mycode_b">With </span>yapısı kısaca, aynı koleksiyona ait komut yapılarını kullanarak hazırladığımız kodları kısaltmamızı sağlar.. Ayrıca bu yapıyı uyguladığımız komutlarımızın daha hızlı çalıştığını göreceksiniz..<br />
<br />
Kullanımı basit ve de karışık kod bloklarımızı sadeleştiren bu yapının uygulanışına bir örnek vereyim..:<br />
<br />
Diyelim ki şöyle bir kod bloğumuz var..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span>Maximize</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span>OpenForm &quot;form1&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span>GoToRecord <span style="color: #7B927B;">,</span> <span style="color: #7B927B;">,</span> acNewRec</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span>GoToControl &quot;metin1&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span>Requery</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #151B8D; font-weight: bold;">DoCmd</span><span style="color: #7B927B;">.</span><span style="color: #268bd2; font-weight: bold;">Close</span></div></li></ol></pre></code></div></div><br /><br />
<br />
İnsan, Docmd yazmaktan sivilce çıkartır.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
İşte with burada imdada yetişir ve pürüzsüz bir cilt sağlar.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">With</span> <span style="color: #151B8D; font-weight: bold;">DoCmd</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Maximize</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>OpenForm &quot;form1&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>GoToRecord <span style="color: #7B927B;">,</span> <span style="color: #7B927B;">,</span> acNewRec</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>GoToControl &quot;metin1&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Requery</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span><span style="color: #268bd2; font-weight: bold;">Close</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">With</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
Bu da başka bir örnek..<br />
<br />
<span style="font-weight: bold;" class="mycode_b">With</span> den Önce.. <br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>SetFocus</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>Text <span style="color: #7B927B;">=</span> &quot;<span style="color: #FF0000; font-weight: bold;">trz</span> 2011&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>FontBold <span style="color: #7B927B;">=</span> <span style="color: #718c00; font-weight: bold;">True</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>FontSize <span style="color: #7B927B;">=</span> 25</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>ForeColor <span style="color: #7B927B;">=</span> vbRed</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>Width <span style="color: #7B927B;">=</span> 3000</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin1<span style="color: #7B927B;">.</span>Height <span style="color: #7B927B;">=</span> 500</div></li></ol></pre></code></div></div><br /><br />
<br />
<span style="font-weight: bold;" class="mycode_b">With </span>den Sonra..<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">With</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>SetFocus</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Text <span style="color: #7B927B;">=</span> &quot;<span style="color: #FF0000; font-weight: bold;">trz</span> 2011&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>FontBold <span style="color: #7B927B;">=</span> <span style="color: #718c00; font-weight: bold;">True</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>FontSize <span style="color: #7B927B;">=</span> 25</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>ForeColor <span style="color: #7B927B;">=</span> vbRed</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Width <span style="color: #7B927B;">=</span> 3000</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Height <span style="color: #7B927B;">=</span> 500</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">With</span></div></li></ol></pre></code></div></div><br /><br />
<br />
With esnektir.. İçerisinde karar yapıları da kullanabiliriz.. İf Then Else ile bir örnek..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">With</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>SetFocus</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Text <span style="color: #7B927B;">=</span> &quot;<span style="color: #FF0000; font-weight: bold;">trz</span> 2011&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>FontBold <span style="color: #7B927B;">=</span> <span style="color: #718c00; font-weight: bold;">True</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">If</span> Metin2 <span style="color: #7B927B;">=</span> &quot;büyük&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #7B927B;">.</span>FontSize <span style="color: #7B927B;">=</span> 25</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #7B927B;">.</span>FontSize <span style="color: #7B927B;">=</span> 12</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>ForeColor <span style="color: #7B927B;">=</span> vbRed</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Width <span style="color: #7B927B;">=</span> 3000</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #7B927B;">.</span>Height <span style="color: #7B927B;">=</span> 500</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">With</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Taruz... 2011</span></span></span>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SELECT - CASE Karar Yapısı]]></title>
			<link>https://www.access-sql.com/Konu-SELECT-CASE-Karar-Yapisi</link>
			<pubDate>Thu, 19 May 2011 18:47:30 +0300</pubDate>
			<guid isPermaLink="false">https://www.access-sql.com/Konu-SELECT-CASE-Karar-Yapisi</guid>
			<description><![CDATA[<span style="font-size: x-small;" class="mycode_size"><span style="color: #696969;" class="mycode_color"><span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">GİRİŞ</span><br />
<br />
Access ile hazırladığımız uygulamalarımızda yapmak istediklerimiz arttıkça artık menülerin, sihirbazların, makroların yetersiz kaldığını hissederiz.. Ama biz uygulamalarımızın daha özgün, esnek ve de kullanışlı olmasını istiyoruz.. Bu da demektir ki artık ufak ufak kod yazmayı öğrenmenin zamanı gelmiştir.. <br />
<br />
</span></span></span><br />
<br />
<br />
Merhaba arkadaşlar..<br />
<br />
Select Case karar yapısı bir önceki konuda işlediğimiz İf - Then - Else karar yapısının (özellikle Else kısmının) daha efektif kullanılmasını sağlar.. Koşul sonucunun döndürdüğü değerlere göre yapılacak işlemler çoksa yani değişkenin döndürdüğü sonuç birden fazlasya select case kullanmak kesinlikle daha iyidir.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
Temel yapı bu şekilde..:<br />
<br />
<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="color: #FF0000;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Select Case</span></span> <span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color">Değişken</span></span><span style="color: #9B8E23;" class="mycode_color"><br />
<br />
<span style="font-weight: bold;" class="mycode_b">Case</span></span><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color"> Değişken değeri</span></span><span style="color: #A9A9A9;" class="mycode_color"><br />
<span style="font-style: italic;" class="mycode_i">Değer eşitlendiğinde yapılmasını istediğimiz işlemler..</span></span></span><br />
<span style="color: #6B8E23;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Case</span></span><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color"> Değişken değeri</span></span><span style="color: #A9A9A9;" class="mycode_color"><br />
<span style="font-style: italic;" class="mycode_i">Değer eşitlendiğinde yapılmasını istediğimiz işlemler..</span></span></span><br />
<span style="color: #C71585;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Case Else</span></span><br />
<span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color"><span style="font-style: italic;" class="mycode_i">Değişken değeri hiç bir koşulla örtüşmediğinde yapılmasını istediğimiz işlemler..</span></span></span><br />
<br />
<span style="color: #0000CD;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">End Select</span></span></span><br />
<br />
<br />
<br />
Formunuzun üzerine iki adet metin kutusu (metin1, metin2) ve bir komut düğmesi (komut1) yerleştirin..<br />
<br />
Düğmenin tıklandığında olayına bu yapıyı kullanalım şimdi:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Select</span> <span style="color: #268bd2; font-weight: bold;">Case</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;elma&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;ıspanak&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;sebze&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">Select</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Tercüme edelim..:<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin1 de "elma" yazıyorsa metin2 de "meyve" yazsın "ıspanak" yazıyorsa "sebze" yazsın</span></span><br />
<br />
Geliştirelim..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Select</span> <span style="color: #268bd2; font-weight: bold;">Case</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;elma&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;ıspanak&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;sebze&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> <span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;türü belli değil&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">Select</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin1 de "elma" yazıyorsa metin2 de "meyve" yazsın "ıspanak" yazıyorsa "sebze" yazsın. Bu değerlerden başka değer yazıyorsa "türü belli değil" yazsın. </span></span><br />
<br />
Şartları geliştirelim..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Select</span> <span style="color: #268bd2; font-weight: bold;">Case</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;elma&quot;<span style="color: #7B927B;">,</span> &quot;portakal&quot; <span style="color: #008000;">'metin1, bu iki değerden biri ise</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot; <span style="color: #008000;">'meyve yazsın</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;ıspanak&quot;<span style="color: #7B927B;">,</span> &quot;lahana&quot; <span style="color: #008000;">'metin1, bu iki değerden biri ise</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;sebze&quot; <span style="color: #008000;">'sebze yazsın</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> <span style="color: #268bd2; font-weight: bold;">Else</span> <span style="color: #008000;">'hiçbiri ise </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;türü belli değil&quot; <span style="color: #008000;">'bunu yazsın</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">Select</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
Select Case yapısını çok değişik şekillerde fonksiyonlar ve operatörler yardımı ile de kullanabiliriz.. Bu tamamen sizin ne istediğinize bağlı.. <br />
<br />
Örnek vermeden olmaz..: <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Select</span> <span style="color: #268bd2; font-weight: bold;">Case</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 5</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;1 ile 5 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 6 <span style="color: #268bd2; font-weight: bold;">To</span> 10</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;6 ile 10 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 11 <span style="color: #268bd2; font-weight: bold;">To</span> 15</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;11 ile 15 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> <span style="color: #268bd2; font-weight: bold;">Is</span> <span style="color: #7B927B;">&gt;</span> 15</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;15 den büyük bir sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">Select</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Bu da farklı bir örnek.. Dikkat edin içinde If - Then - Else de kullandık..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Select</span> <span style="color: #268bd2; font-weight: bold;">Case</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 5</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> 3 <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        Metin2 <span style="color: #7B927B;">=</span> &quot;3 rakamını girdiniz<span style="color: #7B927B;">..</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        Metin2 <span style="color: #7B927B;">=</span> &quot;1 ile 5 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 6 <span style="color: #268bd2; font-weight: bold;">To</span> 10</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;6 ile 10 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 11 <span style="color: #268bd2; font-weight: bold;">To</span> 15</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;11 ile 15 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> <span style="color: #268bd2; font-weight: bold;">Is</span> <span style="color: #7B927B;">&gt;</span> 15</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;15 den büyük bir sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">Select</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Taruz... 2011</span></span></span><br />
  <br />
<br />
<br />
<br />
]]></description>
			<content:encoded><![CDATA[<span style="font-size: x-small;" class="mycode_size"><span style="color: #696969;" class="mycode_color"><span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">GİRİŞ</span><br />
<br />
Access ile hazırladığımız uygulamalarımızda yapmak istediklerimiz arttıkça artık menülerin, sihirbazların, makroların yetersiz kaldığını hissederiz.. Ama biz uygulamalarımızın daha özgün, esnek ve de kullanışlı olmasını istiyoruz.. Bu da demektir ki artık ufak ufak kod yazmayı öğrenmenin zamanı gelmiştir.. <br />
<br />
</span></span></span><br />
<br />
<br />
Merhaba arkadaşlar..<br />
<br />
Select Case karar yapısı bir önceki konuda işlediğimiz İf - Then - Else karar yapısının (özellikle Else kısmının) daha efektif kullanılmasını sağlar.. Koşul sonucunun döndürdüğü değerlere göre yapılacak işlemler çoksa yani değişkenin döndürdüğü sonuç birden fazlasya select case kullanmak kesinlikle daha iyidir.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
Temel yapı bu şekilde..:<br />
<br />
<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="color: #FF0000;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Select Case</span></span> <span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color">Değişken</span></span><span style="color: #9B8E23;" class="mycode_color"><br />
<br />
<span style="font-weight: bold;" class="mycode_b">Case</span></span><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color"> Değişken değeri</span></span><span style="color: #A9A9A9;" class="mycode_color"><br />
<span style="font-style: italic;" class="mycode_i">Değer eşitlendiğinde yapılmasını istediğimiz işlemler..</span></span></span><br />
<span style="color: #6B8E23;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Case</span></span><span style="font-size: small;" class="mycode_size"><span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color"> Değişken değeri</span></span><span style="color: #A9A9A9;" class="mycode_color"><br />
<span style="font-style: italic;" class="mycode_i">Değer eşitlendiğinde yapılmasını istediğimiz işlemler..</span></span></span><br />
<span style="color: #C71585;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Case Else</span></span><br />
<span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color"><span style="font-style: italic;" class="mycode_i">Değişken değeri hiç bir koşulla örtüşmediğinde yapılmasını istediğimiz işlemler..</span></span></span><br />
<br />
<span style="color: #0000CD;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">End Select</span></span></span><br />
<br />
<br />
<br />
Formunuzun üzerine iki adet metin kutusu (metin1, metin2) ve bir komut düğmesi (komut1) yerleştirin..<br />
<br />
Düğmenin tıklandığında olayına bu yapıyı kullanalım şimdi:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Select</span> <span style="color: #268bd2; font-weight: bold;">Case</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;elma&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;ıspanak&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;sebze&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">Select</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Tercüme edelim..:<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin1 de "elma" yazıyorsa metin2 de "meyve" yazsın "ıspanak" yazıyorsa "sebze" yazsın</span></span><br />
<br />
Geliştirelim..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Select</span> <span style="color: #268bd2; font-weight: bold;">Case</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;elma&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;ıspanak&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;sebze&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> <span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;türü belli değil&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">Select</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">metin1 de "elma" yazıyorsa metin2 de "meyve" yazsın "ıspanak" yazıyorsa "sebze" yazsın. Bu değerlerden başka değer yazıyorsa "türü belli değil" yazsın. </span></span><br />
<br />
Şartları geliştirelim..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Select</span> <span style="color: #268bd2; font-weight: bold;">Case</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;elma&quot;<span style="color: #7B927B;">,</span> &quot;portakal&quot; <span style="color: #008000;">'metin1, bu iki değerden biri ise</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot; <span style="color: #008000;">'meyve yazsın</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> &quot;ıspanak&quot;<span style="color: #7B927B;">,</span> &quot;lahana&quot; <span style="color: #008000;">'metin1, bu iki değerden biri ise</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;sebze&quot; <span style="color: #008000;">'sebze yazsın</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Case</span> <span style="color: #268bd2; font-weight: bold;">Else</span> <span style="color: #008000;">'hiçbiri ise </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;türü belli değil&quot; <span style="color: #008000;">'bunu yazsın</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">Select</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
Select Case yapısını çok değişik şekillerde fonksiyonlar ve operatörler yardımı ile de kullanabiliriz.. Bu tamamen sizin ne istediğinize bağlı.. <br />
<br />
Örnek vermeden olmaz..: <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Select</span> <span style="color: #268bd2; font-weight: bold;">Case</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 5</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;1 ile 5 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 6 <span style="color: #268bd2; font-weight: bold;">To</span> 10</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;6 ile 10 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 11 <span style="color: #268bd2; font-weight: bold;">To</span> 15</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;11 ile 15 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> <span style="color: #268bd2; font-weight: bold;">Is</span> <span style="color: #7B927B;">&gt;</span> 15</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;15 den büyük bir sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">Select</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Bu da farklı bir örnek.. Dikkat edin içinde If - Then - Else de kullandık..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Select</span> <span style="color: #268bd2; font-weight: bold;">Case</span> Metin1</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 1 <span style="color: #268bd2; font-weight: bold;">To</span> 5</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> 3 <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        Metin2 <span style="color: #7B927B;">=</span> &quot;3 rakamını girdiniz<span style="color: #7B927B;">..</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        Metin2 <span style="color: #7B927B;">=</span> &quot;1 ile 5 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 6 <span style="color: #268bd2; font-weight: bold;">To</span> 10</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;6 ile 10 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> 11 <span style="color: #268bd2; font-weight: bold;">To</span> 15</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;11 ile 15 arasında sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #268bd2; font-weight: bold;">Case</span> <span style="color: #268bd2; font-weight: bold;">Is</span> <span style="color: #7B927B;">&gt;</span> 15</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Metin2 <span style="color: #7B927B;">=</span> &quot;15 den büyük bir sayı girdiniz<span style="color: #7B927B;">.</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">Select</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Taruz... 2011</span></span></span><br />
  <br />
<br />
<br />
<br />
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[IF - THEN - ELSE Karar Yapısı]]></title>
			<link>https://www.access-sql.com/Konu-IF-THEN-ELSE-Karar-Yapisi</link>
			<pubDate>Thu, 19 May 2011 14:32:58 +0300</pubDate>
			<guid isPermaLink="false">https://www.access-sql.com/Konu-IF-THEN-ELSE-Karar-Yapisi</guid>
			<description><![CDATA[<span style="font-size: x-small;" class="mycode_size"><span style="color: #696969;" class="mycode_color"><span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">GİRİŞ</span><br />
<br />
Access ile hazırladığımız uygulamalarımızda yapmak istediklerimiz arttıkça artık menülerin, sihirbazların, makroların yetersiz kaldığını hissederiz.. Ama biz uygulamalarımızın daha özgün, esnek ve de kullanışlı olmasını istiyoruz.. Bu da demektir ki artık ufak ufak kod yazmayı öğrenmenin zamanı gelmiştir.. <br />
<br />
</span></span></span><br />
<br />
<br />
Merhaba arkadaşlar..<br />
<br />
İf - Then - Else karar yapısı en sık kullandığımız yapılardan biridir.. Oldukça esnek ve kullanışlı olan bu yapıyı hazırlamak kolay ve keyiflidir.. <br />
<br />
Temel yapı bu şekilde..:<br />
<br />
<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="color: #FF0000;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">If</span></span> <span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color">Koşul </span></span><span style="color: #6B8E23;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Then</span></span><br />
<span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color">Koşul oluştuğunda yapılmasını istediğimiz işlemler..</span></span><br />
<span style="color: #C71585;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Else</span></span><br />
<span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color">Koşul oluşmadığında yapılmasını istediğimiz işlemler..</span></span><br />
<span style="color: #0000CD;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">End If</span></span></span><br />
<br />
<br />
<br />
Formunuzun üzerine iki adet metin kutusu (metin1, metin2) ve bir komut düğmesi (komut1) yerleştirin..<br />
Düğmenin tıklandığında olayına bu yapıyı kullanalım şimdi:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Formu şimdi açıp metin1 e elma yazın ve düğmeyi tıklayın.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
Türkçe meali..:<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">Eğer metin1 de elma yazıyorsa metin2 ye meyve yaz..</span></span><br />
<br />
Yapı yukarıdaki gibi tek şart ve tek sonuçtan oluşuyorsa işi End If kullanmadan tek satırla da bitirebiliriz..<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">Then</span> Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li></ol></pre></code></div></div><br /><br />
<br />
Şimdi yapıya <span style="font-weight: bold;" class="mycode_b">Else </span>dahil edip kodumuzu geliştirelim..:<br />
<br />
Yukarıdaki yapıda metin1 de elma harici bir eğer varsa metin2 de bir şey yazmaz.. Şimdi Else kullanarak istediğimiz şart oluşmadığında metin2 ye değer yazalım..:<br />
<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;Türü belli değil<span style="color: #7B927B;">..</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Şimdi diğer bir aşama..: <span style="font-weight: bold;" class="mycode_b">ElseIf</span><br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">ElseIf</span> Metin1 <span style="color: #7B927B;">=</span> &quot;ıspanak&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;sebze&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;Türü belli değil<span style="color: #7B927B;">..</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Meali..:<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-style: italic;" class="mycode_i">Eğer metin1 de elma yazıyorsa metin2 ye "meyve" yaz. Yok eğer ıspanak yazıyorsa metin2 ye "sebze" yaz.. Bunlardan başka bir şey yazıyorsa "türü belli değil" yaz..</span></span><br />
<br />
Koşulları arttırabiliriz..:<br />
<br />
Formumuza bir metin kutusu (metin3) daha ilave edelim..<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">And</span> Metin3 <span style="color: #7B927B;">=</span> &quot;amasya&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;yerli meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;Türü belli değil<span style="color: #7B927B;">..</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">Eğer metin1 de "elma" <span style="color: #FF0000;" class="mycode_color">ve</span> metin3 de "amasya" yazıyorsa metin2 de "yerli meyve" yaz.. Bu iki şart gerçekleşmiyorsa "Türü belli değil.." yaz.</span></span><br />
<br />
Bu da <span style="font-weight: bold;" class="mycode_b">Or </span>operatörü ile kullanımı..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">Or</span> Metin3 <span style="color: #7B927B;">=</span> &quot;portakal&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;Türü belli değil<span style="color: #7B927B;">..</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">Eğer metin1 de "elma" <span style="color: #FF0000;" class="mycode_color">ya da</span> metin3 de "portakal" yazıyorsa metin2 de "meyve" yaz.. Bu iki şart gerçekleşmiyorsa "Türü belli değil.." yaz.</span></span><br />
<br />
<br />
<br />
Bu yapı içerisinde bir çok karşılaştırma operatörünü kullanabiliriz..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">&lt;&gt;</span>   <span style="color: #008000;">'..... Eşit değilse</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> IsNull<span style="color: #7B927B;">(</span>Metin1<span style="color: #7B927B;">)</span> <span style="color: #008000;">'..... Boşsa </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> <span style="color: #268bd2; font-weight: bold;">Not</span> IsNull<span style="color: #7B927B;">(</span>Metin1<span style="color: #7B927B;">)</span> <span style="color: #008000;">'..... Boş değilse </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">&gt;</span>   <span style="color: #008000;">'..... Büyükse</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">&gt;=</span>   <span style="color: #008000;">'..... Eşit ve Büyükse</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">&lt;</span>   <span style="color: #008000;">'..... Küçükse</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">&lt;=</span>   '<span style="color: #7B927B;">.....</span> Eşit ve Küçükse</div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
Yapı, temel olarak bu şekilde.. Daha da detaylandırıp kafa karıştımayalım.. Özümsedikten sonra kendiniz zaten daha da gelişmiş yapıları oluşturacaksınızdır.. <br />
<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Taruz... 2011</span></span></span><br />
  <br />
]]></description>
			<content:encoded><![CDATA[<span style="font-size: x-small;" class="mycode_size"><span style="color: #696969;" class="mycode_color"><span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">GİRİŞ</span><br />
<br />
Access ile hazırladığımız uygulamalarımızda yapmak istediklerimiz arttıkça artık menülerin, sihirbazların, makroların yetersiz kaldığını hissederiz.. Ama biz uygulamalarımızın daha özgün, esnek ve de kullanışlı olmasını istiyoruz.. Bu da demektir ki artık ufak ufak kod yazmayı öğrenmenin zamanı gelmiştir.. <br />
<br />
</span></span></span><br />
<br />
<br />
Merhaba arkadaşlar..<br />
<br />
İf - Then - Else karar yapısı en sık kullandığımız yapılardan biridir.. Oldukça esnek ve kullanışlı olan bu yapıyı hazırlamak kolay ve keyiflidir.. <br />
<br />
Temel yapı bu şekilde..:<br />
<br />
<br />
<br />
<span style="font-size: large;" class="mycode_size"><span style="color: #FF0000;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">If</span></span> <span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color">Koşul </span></span><span style="color: #6B8E23;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Then</span></span><br />
<span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color">Koşul oluştuğunda yapılmasını istediğimiz işlemler..</span></span><br />
<span style="color: #C71585;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">Else</span></span><br />
<span style="font-size: small;" class="mycode_size"><span style="color: #A9A9A9;" class="mycode_color">Koşul oluşmadığında yapılmasını istediğimiz işlemler..</span></span><br />
<span style="color: #0000CD;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">End If</span></span></span><br />
<br />
<br />
<br />
Formunuzun üzerine iki adet metin kutusu (metin1, metin2) ve bir komut düğmesi (komut1) yerleştirin..<br />
Düğmenin tıklandığında olayına bu yapıyı kullanalım şimdi:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Formu şimdi açıp metin1 e elma yazın ve düğmeyi tıklayın.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
Türkçe meali..:<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">Eğer metin1 de elma yazıyorsa metin2 ye meyve yaz..</span></span><br />
<br />
Yapı yukarıdaki gibi tek şart ve tek sonuçtan oluşuyorsa işi End If kullanmadan tek satırla da bitirebiliriz..<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">Then</span> Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li></ol></pre></code></div></div><br /><br />
<br />
Şimdi yapıya <span style="font-weight: bold;" class="mycode_b">Else </span>dahil edip kodumuzu geliştirelim..:<br />
<br />
Yukarıdaki yapıda metin1 de elma harici bir eğer varsa metin2 de bir şey yazmaz.. Şimdi Else kullanarak istediğimiz şart oluşmadığında metin2 ye değer yazalım..:<br />
<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;Türü belli değil<span style="color: #7B927B;">..</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Şimdi diğer bir aşama..: <span style="font-weight: bold;" class="mycode_b">ElseIf</span><br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">ElseIf</span> Metin1 <span style="color: #7B927B;">=</span> &quot;ıspanak&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;sebze&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;Türü belli değil<span style="color: #7B927B;">..</span>&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li></ol></pre></code></div></div><br /><br />
<br />
Meali..:<br />
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-style: italic;" class="mycode_i">Eğer metin1 de elma yazıyorsa metin2 ye "meyve" yaz. Yok eğer ıspanak yazıyorsa metin2 ye "sebze" yaz.. Bunlardan başka bir şey yazıyorsa "türü belli değil" yaz..</span></span><br />
<br />
Koşulları arttırabiliriz..:<br />
<br />
Formumuza bir metin kutusu (metin3) daha ilave edelim..<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">And</span> Metin3 <span style="color: #7B927B;">=</span> &quot;amasya&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;yerli meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;Türü belli değil<span style="color: #7B927B;">..</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">Eğer metin1 de "elma" <span style="color: #FF0000;" class="mycode_color">ve</span> metin3 de "amasya" yazıyorsa metin2 de "yerli meyve" yaz.. Bu iki şart gerçekleşmiyorsa "Türü belli değil.." yaz.</span></span><br />
<br />
Bu da <span style="font-weight: bold;" class="mycode_b">Or </span>operatörü ile kullanımı..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">=</span> &quot;elma&quot; <span style="color: #268bd2; font-weight: bold;">Or</span> Metin3 <span style="color: #7B927B;">=</span> &quot;portakal&quot; <span style="color: #268bd2; font-weight: bold;">Then</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;meyve&quot;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">Else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Metin2 <span style="color: #7B927B;">=</span> &quot;Türü belli değil<span style="color: #7B927B;">..</span>&quot;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">End</span> <span style="color: #268bd2; font-weight: bold;">If</span></div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">Eğer metin1 de "elma" <span style="color: #FF0000;" class="mycode_color">ya da</span> metin3 de "portakal" yazıyorsa metin2 de "meyve" yaz.. Bu iki şart gerçekleşmiyorsa "Türü belli değil.." yaz.</span></span><br />
<br />
<br />
<br />
Bu yapı içerisinde bir çok karşılaştırma operatörünü kullanabiliriz..:<br />
<br />
<div class="codeblock"><div class="title">Visual Basic</div><div class="body"><code><pre class="vba" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">&lt;&gt;</span>   <span style="color: #008000;">'..... Eşit değilse</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> IsNull<span style="color: #7B927B;">(</span>Metin1<span style="color: #7B927B;">)</span> <span style="color: #008000;">'..... Boşsa </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> <span style="color: #268bd2; font-weight: bold;">Not</span> IsNull<span style="color: #7B927B;">(</span>Metin1<span style="color: #7B927B;">)</span> <span style="color: #008000;">'..... Boş değilse </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">&gt;</span>   <span style="color: #008000;">'..... Büyükse</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">&gt;=</span>   <span style="color: #008000;">'..... Eşit ve Büyükse</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">&lt;</span>   <span style="color: #008000;">'..... Küçükse</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #268bd2; font-weight: bold;">If</span> Metin1 <span style="color: #7B927B;">&lt;=</span>   '<span style="color: #7B927B;">.....</span> Eşit ve Küçükse</div></li></ol></pre></code></div></div><br /><br />
<br />
<br />
Yapı, temel olarak bu şekilde.. Daha da detaylandırıp kafa karıştımayalım.. Özümsedikten sonra kendiniz zaten daha da gelişmiş yapıları oluşturacaksınızdır.. <br />
<br />
<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Taruz... 2011</span></span></span><br />
  <br />
]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Ms Access ile Kod Yazmaya Giriş ]]></title>
			<link>https://www.access-sql.com/Konu-Ms-Access-ile-Kod-Yazmaya-Giris</link>
			<pubDate>Thu, 19 May 2011 13:21:35 +0300</pubDate>
			<guid isPermaLink="false">https://www.access-sql.com/Konu-Ms-Access-ile-Kod-Yazmaya-Giris</guid>
			<description><![CDATA[<br />
<br />
<br />
Merhaba arkadaşlar..<br />
<br />
Access ile hazırladığımız uygulamalarımızda yapmak istediklerimiz arttıkça artık menülerin, sihirbazların, makroların yetersiz kaldığını hissederiz.. Ama biz uygulamalarımızın daha özgün, esnek ve de kullanışlı olmasını istiyoruz.. Bu da demektir ki artık ufak ufak kod yazmayı öğrenmenin zamanı gelmiştir.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
Access (ve diğer office programları) içerisinde Visiual Basic programlama dilini biraz da basitleştirerek application olarak barındırır.. Accesste kod yazarken bu dili kullanırız.. Bu dili iyi kötü öğrenen herkes diğer programlama uygulamalarında da kod yazar hale gelir.. <br />
<br />
Bu konu serisinde sizlere kod yazma ile ilgili belli temel yapıları göstereceğim.. Ansiklopedik bir dokümandan ziyade Acceess içerisinde sıklıkla kullandığımız komutları, yapıları ve bunlarla ilgili ipuçlarını vermeye çalışacağım..<br />
<br />
<br />
Kodlarımızı VBA editörü üzerinde yazarız.. Düzenleyiciye ulaşmak için <span style="font-weight: bold;" class="mycode_b">Oluştur </span>menü sekmesindeki <span style="font-weight: bold;" class="mycode_b">Visual Basic</span> düğmesine veya  <span style="font-weight: bold;" class="mycode_b">Alt </span>ve <span style="font-weight: bold;" class="mycode_b">F11 </span>tuşlarına bereberce basmanız yeterlidir..:<br />
<br />
<img src="http://www.access-sql.com/resim/vbadugme.jpg" alt="[Resim: vbadugme.jpg]" class="mycode_img" /><br />
<br />
Bir form üzerinde kod yazmak istiyorsanız formunuz tasarım görünümündeyken <span style="font-weight: bold;" class="mycode_b">Alt </span>+ <span style="font-weight: bold;" class="mycode_b">F11 </span> yapabileceğiniz gibi bu düğmeyi de kullanabilirsiniz..:<br />
<br />
<img src="http://www.access-sql.com/resim/vbadugme2.jpg" alt="[Resim: vbadugme2.jpg]" class="mycode_img" /><br />
<br />
Sayfanın sol üstündeki açılan kutudan kod uygulamak istediğiniz nesneleri seçebilir,<br />
<br />
<img src="http://www.access-sql.com/resim/vbaeditor.jpg" alt="[Resim: vbaeditor.jpg]" class="mycode_img" /><br />
<br />
yazdığınız kodun nesnenin hangi hareketinde çalışmasını istiyorsanız o hareketi seçebilirsiniz..:<br />
<br />
<img src="http://www.access-sql.com/resim/vbaeditor2.jpg" alt="[Resim: vbaeditor2.jpg]" class="mycode_img" /><br />
<br />
Gerçi bu işin uzun yolu.. Kısası..: <br />
<ul class="mycode_list"><li>Formu tasarımda açın <br />
</li>
<li>Kod uygulayacağınız nesneyi seçin<br />
</li>
<li>Özellikler sayfasını açın<br />
</li>
<li>Olay sekmesini tıklayın<br />
</li>
</ul>
<br />
Kod uygulayabileceğimiz olaylar burada..:<br />
<br />
<img src="http://www.access-sql.com/resim/vbaeditor3.jpg" alt="[Resim: vbaeditor3.jpg]" class="mycode_img" /><br />
<br />
İstediğimiz olayın satırındaki üç noktalı düğmeye tıklatın. (olay satırına çift tıklasanız da olur) Kod oluşturucuyu çift tıklayın..<br />
<br />
<img src="http://www.access-sql.com/resim/vbaeditor4.jpg" alt="[Resim: vbaeditor4.jpg]" class="mycode_img" /><br />
<br />
Editör açılır ve imleç ilgili olayın prosedür satırına oturur..:<br />
<br />
<img src="http://www.access-sql.com/resim/vbaeditor5.jpg" alt="[Resim: vbaeditor5.jpg]" class="mycode_img" /><br />
<br />
<br />
Kodlarımızı Sub --- End Sub arasına yazmalıyız..<br />
]]></description>
			<content:encoded><![CDATA[<br />
<br />
<br />
Merhaba arkadaşlar..<br />
<br />
Access ile hazırladığımız uygulamalarımızda yapmak istediklerimiz arttıkça artık menülerin, sihirbazların, makroların yetersiz kaldığını hissederiz.. Ama biz uygulamalarımızın daha özgün, esnek ve de kullanışlı olmasını istiyoruz.. Bu da demektir ki artık ufak ufak kod yazmayı öğrenmenin zamanı gelmiştir.. <img src="https://www.access-sql.com/images/smilies/trz2/wink.gif" alt="Wink" title="Wink" class="smilie smilie_97" /><br />
<br />
Access (ve diğer office programları) içerisinde Visiual Basic programlama dilini biraz da basitleştirerek application olarak barındırır.. Accesste kod yazarken bu dili kullanırız.. Bu dili iyi kötü öğrenen herkes diğer programlama uygulamalarında da kod yazar hale gelir.. <br />
<br />
Bu konu serisinde sizlere kod yazma ile ilgili belli temel yapıları göstereceğim.. Ansiklopedik bir dokümandan ziyade Acceess içerisinde sıklıkla kullandığımız komutları, yapıları ve bunlarla ilgili ipuçlarını vermeye çalışacağım..<br />
<br />
<br />
Kodlarımızı VBA editörü üzerinde yazarız.. Düzenleyiciye ulaşmak için <span style="font-weight: bold;" class="mycode_b">Oluştur </span>menü sekmesindeki <span style="font-weight: bold;" class="mycode_b">Visual Basic</span> düğmesine veya  <span style="font-weight: bold;" class="mycode_b">Alt </span>ve <span style="font-weight: bold;" class="mycode_b">F11 </span>tuşlarına bereberce basmanız yeterlidir..:<br />
<br />
<img src="http://www.access-sql.com/resim/vbadugme.jpg" alt="[Resim: vbadugme.jpg]" class="mycode_img" /><br />
<br />
Bir form üzerinde kod yazmak istiyorsanız formunuz tasarım görünümündeyken <span style="font-weight: bold;" class="mycode_b">Alt </span>+ <span style="font-weight: bold;" class="mycode_b">F11 </span> yapabileceğiniz gibi bu düğmeyi de kullanabilirsiniz..:<br />
<br />
<img src="http://www.access-sql.com/resim/vbadugme2.jpg" alt="[Resim: vbadugme2.jpg]" class="mycode_img" /><br />
<br />
Sayfanın sol üstündeki açılan kutudan kod uygulamak istediğiniz nesneleri seçebilir,<br />
<br />
<img src="http://www.access-sql.com/resim/vbaeditor.jpg" alt="[Resim: vbaeditor.jpg]" class="mycode_img" /><br />
<br />
yazdığınız kodun nesnenin hangi hareketinde çalışmasını istiyorsanız o hareketi seçebilirsiniz..:<br />
<br />
<img src="http://www.access-sql.com/resim/vbaeditor2.jpg" alt="[Resim: vbaeditor2.jpg]" class="mycode_img" /><br />
<br />
Gerçi bu işin uzun yolu.. Kısası..: <br />
<ul class="mycode_list"><li>Formu tasarımda açın <br />
</li>
<li>Kod uygulayacağınız nesneyi seçin<br />
</li>
<li>Özellikler sayfasını açın<br />
</li>
<li>Olay sekmesini tıklayın<br />
</li>
</ul>
<br />
Kod uygulayabileceğimiz olaylar burada..:<br />
<br />
<img src="http://www.access-sql.com/resim/vbaeditor3.jpg" alt="[Resim: vbaeditor3.jpg]" class="mycode_img" /><br />
<br />
İstediğimiz olayın satırındaki üç noktalı düğmeye tıklatın. (olay satırına çift tıklasanız da olur) Kod oluşturucuyu çift tıklayın..<br />
<br />
<img src="http://www.access-sql.com/resim/vbaeditor4.jpg" alt="[Resim: vbaeditor4.jpg]" class="mycode_img" /><br />
<br />
Editör açılır ve imleç ilgili olayın prosedür satırına oturur..:<br />
<br />
<img src="http://www.access-sql.com/resim/vbaeditor5.jpg" alt="[Resim: vbaeditor5.jpg]" class="mycode_img" /><br />
<br />
<br />
Kodlarımızı Sub --- End Sub arasına yazmalıyız..<br />
]]></content:encoded>
		</item>
	</channel>
</rss>