Kenapa 3 baris? Karena waktu saya tulis di outlook kepanjangan :) Dibikin satu baris juga tidak apa-apa.
Native dari MS Access adalah form yang bound ke tabel atau query atau dengan recordsource on the fly dengan manipulasi string sql. Dalam banyak hal ini akan memudahkan kita. Bahkan kalau males bikin hitungan Kita bisa memasukkan formula ke dalam tabel (di access 2010 tipe datanya adalah Calculated). Ruginya Unbound, ya mesti bikin banyak koding yang kalau dengan form unbound Cukup dengan wizard aja. Seperti form navigasi, pake wizard sudah cukup. Combo box pencarian, dengan wizard bisa. Kalau pake unbound, memang bisa sih.. tapi a little bit harder. Pokok-e, kalau ndak kepaksa, jangan pake vba. Salam hangat dan jabat erat, MBA -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of him mah Sent: Tuesday, March 09, 2010 2:35 PM To: [email protected] Subject: Re: [belajar-access] menyederhanakan kode iya lebih sederhana pak, tapi kenapa koq dibagi 3 baris pak? sekalian nanya untuk ruginya form itu unbound atau tidak unbound apa ya? varListKontrol= "A11,A12,A13,A14,A15,A16,A17,A18,A19,B21" varListKontrol=varlistKontrol & ",B22,B23,B24,B25" varlistKontrol=varlistKontrol=",D40,D41,D42,D43,D44,TOTAL" 2010/3/8, MBA <[email protected]>: > > Secara baris, menurut saya ini lebih pendek. > Apa ini lebih sederhana ya? > > Salam hangat dan jabat erat, > MBA > > Sub Rasio() > On Error Resume Next > > varListKontrol= "A11,A12,A13,A14,A15,A16,A17,A18,A19,B21" > varListKontrol=varlistKontrol & ",B22,B23,B24,B25" > varlistKontrol=varlistKontrol=",D40,D41,D42,D43,D44,TOTAL" > > x = Split(varListKontrol, ",") > > For i = 0 To UBound(x) > KL=nz(Controls("L" & x(i)),0) > RL= Controls("R" & x(i)) > Controls("T" & x(i)).value = IIF(KL>0,RL /KL,"") > Next > > End Sub > > > -----Original Message----- > From: [email protected] [mailto:[email protected]] > On Behalf Of him mah > Sent: Tuesday, March 09, 2010 12:46 PM > To: [email protected] > Subject: Re: [belajar-access] menyederhanakan kode > > makasih, punya pak MBA lebih simpel pak > > berarti yang ini juga bisa dibuat lebih simple ya > > Sub Rasio() > If Nz(LA11) > 0 Then > TA11 = RA11 / LA11 > End If > > If Nz(LA12) > 0 Then > TA12 = RA12 / LA12 > End If > > If Nz(LA13) > 0 Then > TA13 = RA13 / LA13 > End If > > If Nz(LA14) > 0 Then > TA14 = RA14 / LA14 > End If > > If Nz(LA15) > 0 Then > TA15 = RA15 / LA15 > End If > > If Nz(LA16) > 0 Then > TA16 = RA16 / LA16 > End If > > If Nz(LA17) > 0 Then > TA17 = RA17 / LA17 > End If > > If Nz(LA18) > 0 Then > TA18 = RA18 / LA18 > End If > > If Nz(LA19) > 0 Then > TA19 = RA19 / LA19 > End If > > If Nz(LB21) > 0 Then > TB21 = RB21 / LB21 > End If > > If Nz(LB22) > 0 Then > TB22 = RB22 / LB22 > End If > > If Nz(LB23) > 0 Then > TB23 = RB23 / LB23 > End If > > If Nz(LB24) > 0 Then > TB24 = RB24 / LB24 > End If > > If Nz(LB25) > 0 Then > TB25 = RB25 / LB25 > End If > > If Nz(LD41) > 0 Then > TD41 = RD41 / LD41 > End If > > If Nz(LD42) > 0 Then > TD42 = RD42 / LD42 > End If > > If Nz(LD43) > 0 Then > TD43 = RD43 / LD43 > End If > > If Nz(LD44) > 0 Then > TD44 = RD44 / LD44 > End If > > If Nz(LA10) > 0 Then > TA10 = RA10 / LA10 > End If > > If Nz(LB20) > 0 Then > TB20 = RB20 / LB20 > End If > > If Nz(LD40) > 0 Then > TD40 = RD40 / LD40 > End If > > If Nz(LTOTAL) > 0 Then > TTOTAL = RTOTAL / LTOTAL > End If > > > End Sub > > 2010/3/8, MBA <[email protected]>: >> Ada ide lain sbb: >> >> >> >> Ntar kalo mau nambah kontrolnya tinggal edit / tambah varListKontrolnya. >> >> List Kontrol itu hanya ngambil digit namanya aja. >> >> >> >> Sub Nol() >> >> On Error Resume Next >> >> >> >> varListKontrol= >> "A11,A12,A13,A14,A15,A16,A17,A18,A19,B21,B22,B23,B24,B25,D41,D42,D43,D44" >> >> x = Split(varListKontrol, ",") >> >> >> >> For i = 0 To UBound(x) >> >> Controls("R" & x(i)).Locked = Nz(Controls("L" & x(i))) = 0 >> >> Next >> >> >> >> End Sub >> >> >> >> _____ >> >> From: [email protected] > [mailto:[email protected]] >> On Behalf Of Aksan Kurdin >> Sent: Tuesday, March 09, 2010 11:45 AM >> To: [email protected] >> Subject: Re: [belajar-access] menyederhanakan kode >> >> >> >> >> >> Cakep .... >> ini udah bahasa programmer ..... >> >> >> aksan kurdin >> >> >> >> On 3/9/2010 11:46 AM, MBA wrote: >> >> >> >> Ini lebih sederhana tidak ya? >> >> RA11.LOCKED=NZ(LA11)=0 >> RA12.LOCKED=NZ(LA12)=0 >> RA13.LOCKED=NZ(LA13)=0 >> RA14.LOCKED=NZ(LA14)=0 >> RA15.LOCKED=NZ(LA15)=0 >> RA16.LOCKED=NZ(LA16)=0 >> RA17.LOCKED=NZ(LA17)=0 >> RA18.LOCKED=NZ(LA18)=0 >> RA19.LOCKED=NZ(LA19)=0 >> >> RB21.LOCKED=NZ(LB21)=0 >> RB22.LOCKED=NZ(LB22)=0 >> RB23.LOCKED=NZ(LB23)=0 >> RB24.LOCKED=NZ(LB24)=0 >> RB25.LOCKED=NZ(LB25)=0 >> >> RD41.LOCKED=NZ(LD41)=0 >> RD42.LOCKED=NZ(LD42)=0 >> RD43.LOCKED=NZ(LD43)=0 >> RD44.LOCKED=NZ(LD44)=0 >> >> Salam, MBA >> >> -----Original Message----- >> From: belajar-access@ <mailto:belajar-access%40yahoogroups.com> >> yahoogroups.com [mailto:belajar-access@ >> <mailto:belajar-access%40yahoogroups.com> yahoogroups.com] >> On Behalf Of him mah >> Sent: Tuesday, March 09, 2010 11:27 AM >> To: belajar-access >> Subject: [belajar-access] menyederhanakan kode >> >> maaf mau tanya, kalau kode dibawah kira-kira bisa disederhanakan ngga? >> >> Sub TidakNol() >> If Nz(LA11) = 0 Then >> RA11.Locked = True >> Else >> RA11.Locked = False >> End If >> >> If Nz(LA12) = 0 Then >> RA12.Locked = True >> Else >> RA12.Locked = False >> End If >> >> If Nz(LA13) = 0 Then >> RA13.Locked = True >> Else >> RA13.Locked = False >> End If >> >> If Nz(LA14) = 0 Then >> RA14.Locked = True >> Else >> RA14.Locked = False >> End If >> >> If Nz(LA15) = 0 Then >> RA15.Locked = True >> Else >> RA15.Locked = False >> End If >> >> If Nz(LA16) = 0 Then >> RA16.Locked = True >> Else >> RA16.Locked = False >> End If >> >> If Nz(LA17) = 0 Then >> RA17.Locked = True >> Else >> RA17.Locked = False >> End If >> >> If Nz(LA18) = 0 Then >> RA18.Locked = True >> Else >> RA18.Locked = False >> End If >> >> If Nz(LA19) = 0 Then >> RA19.Locked = True >> Else >> RA19.Locked = False >> End If >> >> If Nz(LB21) = 0 Then >> RB21.Locked = True >> Else >> RB21.Locked = False >> End If >> >> If Nz(LB22) = 0 Then >> RB22.Locked = True >> Else >> RB22.Locked = False >> End If >> >> If Nz(LB23) = 0 Then >> RB23.Locked = True >> Else >> RB23.Locked = False >> End If >> >> If Nz(LB24) = 0 Then >> RB24.Locked = True >> Else >> RB24.Locked = False >> End If >> >> If Nz(LB25) = 0 Then >> RB25.Locked = True >> Else >> RB25.Locked = False >> End If >> >> If Nz(LD41) = 0 Then >> RD41.Locked = True >> Else >> RD41.Locked = False >> End If >> >> If Nz(LD42) = 0 Then >> RD42.Locked = True >> Else >> RD42.Locked = False >> End If >> >> If Nz(LD43) = 0 Then >> RD43.Locked = True >> Else >> RD43.Locked = False >> End If >> If Nz(LD44) = 0 Then >> RD44.Locked = True >> Else >> RD44.Locked = False >> End If >> >> End Sub >> >> ------------------------------------ >> >> SPAM IS PROHIBITEDYahoo! Groups Links >> >> No virus found in this incoming message. >> Checked by AVG - www.avg.com >> Version: 9.0.733 / Virus Database: 271.1.1/2731 - Release Date: 03/09/10 >> 02:33:00 >> >> >> >> >> >> >> >> >> >> No virus found in this incoming message. >> Checked by AVG - www.avg.com >> Version: 9.0.733 / Virus Database: 271.1.1/2731 - Release Date: 03/09/10 >> 02:33:00 >> >> >> > > > -- > aCCOUNT rEPRESENTATIVE > KPP Pratama Pasuruan > Jalan Panglima Sudirman 29 Pasuruan > 0343-424125 ext. 211 > > > ------------------------------------ > > SPAM IS PROHIBITEDYahoo! Groups Links > > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.733 / Virus Database: 271.1.1/2731 - Release Date: 03/09/10 > 02:33:00 > > -- aCCOUNT rEPRESENTATIVE KPP Pratama Pasuruan Jalan Panglima Sudirman 29 Pasuruan 0343-424125 ext. 211 ------------------------------------ SPAM IS PROHIBITEDYahoo! Groups Links No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2731 - Release Date: 03/09/10 02:33:00

