Monday, February 2, 2015

Memanfaatkan InputBox Pada MS Access

www.AstroDigi.com AstroDigi.com | Senin, 2 Feb 2015 | Kali ini saya akan membahas cara penggunaan InputBox di aplikasi MS Access. InputBox adalah fungsi yang disediakan bagi user untuk menginput text, lewat sebuah "dialog box" yang tampil secara "pop up" (kotak/ window yang muncul didepan window yang sudah terbuka sebelumnya).

Sintax paling sederhana dari InputBox adalah:
InputBox(prompt)

Contoh:
Dim KetikNama
KetikNama = InputBox("Ketikkan nama Anda")
MsgBox ("Nama Anda: " & KetikNama)      
-----------------------------------------------------------
User bisa menambahkan title/ judul, sintaxnya adalah:
InputBox(prompt[, title])

Contoh:
Dim KetikNama
KetikNama = InputBox("Ketikkan nama Anda", "Kotak Untuk Isi Nama")
MsgBox ("Nama Anda: " & KetikNama)      
-----------------------------------------------------------
User juga bisa menambahkan text "default" (text yang ditetapkan sebagai input, sebelum user mengetikkan input) :
InputBox(prompt[, title][, default])

Contoh:
Dim KetikNama
KetikNama = InputBox("Ketikkan nama Anda", "Kotak Untuk Isi Nama", "AstroDigi")       
MsgBox ("Nama Anda: " & KetikNama)      
-----------------------------------------------------------
Anda bisa memanfaatkan fasilitas InputBox ini sebagai sarana untuk mempassword sebuah form atau juga seluruh aplikasi anda, jadi sebelum masuk kedalam aplikasi user diminta untuk mengetikkan password dulu.

Sisipkan script berikut dievent OnOpen form sebagai berikut:

passwordKu = InputBox("Ketikkan password Anda", "Kotak Untuk Isi Password", "AstroDigi")        
if passwordKu <> "123456789" then cancel = -1
    Exit Sub
End If
-----------------------------------------------------------
Saat form dibuka, event OnOpen akan mengeksekusi instruksi diatas. Jika user tidak mengisi dengan password yang benar (= 123456789), maka form tidak akan terbuka.

Tentu saja passwordnya bisa anda ganti sesuka anda (tidak harus "123456789"). Dan bila anda ingin keluar dari aplikasi, apabila terjadi kesalahan input password (bukan hanya mencegah sebuah form terbuka), maka anda bisa mengganti Exit Sub dengan instruksi "Quit".

Akhir kata selamat mencoba, have a nice day :-)

 www.AstroDigi.com (Nino Guevara Ruwano)

Comments :

3 comments to “Memanfaatkan InputBox Pada MS Access”

air force, true religion jeans, nike blazer, nike air max, ralph lauren uk, lululemon, north face, hollister pas cher, timberland, north face, sac guess, ray ban uk, ray ban pas cher, oakley pas cher, nike free run uk, true religion outlet, michael kors, true religion jeans, air jordan pas cher, air max, lacoste pas cher, nike air max, converse pas cher, nike free, mulberry, louboutin pas cher, ralph lauren pas cher, longchamp pas cher, nike roshe run, new balance pas cher, sac longchamp, abercrombie and fitch, nike air max, vans pas cher, burberry, hermes, michael kors, hogan, tn pas cher, hollister, vanessa bruno, michael kors

Unknown said...
on 

longchamp, hollister, soccer jerseys, north face outlet, instyler, celine handbags, baseball bats, iphone 6 cases, insanity workout, ghd, nike roshe, mont blanc, chi flat iron, jimmy choo shoes, wedding dresses, nike huarache, herve leger, mac cosmetics, hollister, nike roshe, mcm handbags, north face outlet, asics running shoes, timberland boots, babyliss, birkin bag, oakley, giuseppe zanotti, nike trainers, ferragamo shoes, vans shoes, lululemon, nfl jerseys, p90x workout, bottega veneta, reebok shoes, new balance, abercrombie and fitch, nike air max, valentino shoes, soccer shoes, beats by dre

Unknown said...
on 

longchamp handbags, http://www.longchamphandbag.us.com/
nike air max shoes, http://www.nikeairmaxshoess.co.uk/
michael kors outlet store, http://www.michaelkorsoutlet-store.us.com/
toms outlet, http://www.tomsoutlet-stores.com/
cheap wedding dresses, http://www.cheap-weddingdresses.net/
soccer jerseys,cheap soccer jerseys,cheap soccer jerseys for sale,soccer jersey,usa soccer jersey,football jerseys
lululemon outlet, http://www.lululemonoutletstore.in.net/
beats headphones, http://www.beats-headphones.in.net/
mont blanc, http://www.montblancpensoutlets.com/
fred perry polo, http://www.fredperrypoloshirts.com/
nike mercurial, http://www.nikemercurial.org/
cheap michael kors handbags, http://www.cheapmichaelkorshandbag.in.net/
louis vuitton outlet online, http://www.louisvuitton.in.net/
ysl outlet store, http://www.ysloutletonline.com/
kobe bryant store, http://www.kobebryantshoes.in.net/
longchamp bags, http://www.longchamphandbag.us.com/
bottega veneta outlet, http://www.bottegaveneta-outlet.net/
washington redskins jerseys, http://www.washingtonredskinsjersey.com/
rolex watches, http://www.rolexwatches.in.net/
giuseppe zanotti sale, http://www.giuseppe-zanotti-outlet.org/
mm0917

mmjiaxin said...
on 

Post a Comment