SlideShare a Scribd company logo
1 of 3
Download to read offline
Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014
STMIK MIC Cikarang Halaman - 1
Pengetikan Coding pada Form Front Office :
Tombol : Tambah
Private Sub Command1_Click(Index As Integer)
Text1.SetFocus
Adodc1.Recordset.AddNew
pesan = MsgBox("Anda mau menambah data?", vbInformation, "Informasi")
Text1.Text = ""
Text2.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Adodc1.Recordset!nip = ""
Adodc1.Recordset!nama_peg = ""
Adodc1.Recordset!shift = ""
Adodc1.Recordset!Status = ""
End Sub
Tombol : Simpan
Private Sub command2_Click(Index As Integer)
Adodc1.Recordset.Fields("nip") = Text1.Text
Adodc1.Recordset.Fields("nama_peg") = Text2.Text
Adodc1.Recordset.Fields("shift") = Combo1.Text
Adodc1.Recordset.Fields("status") = Combo2.Text
MsgBox "Data sudah disimpan"
Text1.Text = ""
Text2.Text = ""
Combo1.Text = ""
Combo2.Text = ""
End Sub
Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014
STMIK MIC Cikarang Halaman - 2
Tombol : Edit
Private Sub Command3_Click(Index As Integer)
Adodc1.Recordset!nip = Text1.Text
Adodc1.Recordset!nama_peg = Text2.Text
Adodc1.Recordset!shift = Combo1.Text
Adodc1.Recordset!Status = Combo2.Text
Adodc1.Recordset.Update
MsgBox "Data sudah diubah"
End Sub
Tombol : Hapus
Private Sub Command4_Click(Index As Integer)
Adodc1.Recordset.Delete
Text1.Text = ""
Text2.Text = ""
Combo1.Text = ""
Combo2.Text = ""
MsgBox "Data sudah dihapus"
Adodc1.Refresh
End Sub
Tombol : Batal
Private Sub Command5_Click(Index As Integer)
Text1.Text = ""
Text2.Text = ""
Combo1.Text = ""
Combo2.Text = ""
End Sub
Tombol : Tutup
Private Sub Command6_Click(Index As Integer)
Unload Me
End Sub
Datagrid (klik 2x) :
Private Sub DataGrid1_Click()
Text1 = Adodc1.Recordset!nip
Text2 = Adodc1.Recordset!nama_peg
Combo1 = Adodc1.Recordset!shift
Combo2 = Adodc1.Recordset!Status
End Sub
Coding di Form Load untuk menampilkan Combo1 dan Combo2 :
Private Sub Form_Load()
Combo1.Clear
Combo1.AddItem "1"
Combo1.AddItem "2"
Combo2.Clear
Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014
STMIK MIC Cikarang Halaman - 3
Combo2.AddItem "Tetap"
Combo2.AddItem "Tidak Tetap"
End Sub
Text1.text (Klik 2x) :
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Adodc1.Recordset.MoveFirst
Do While Not Adodc1.Recordset.EOF
If Adodc1.Recordset!nip = Text1.Text Then
MsgBox "Data ditemukan"
Text2 = Adodc1.Recordset!nama_peg
Combo1 = Adodc1.Recordset!shift
Combo2 = Adodc1.Recordset!Status
Exit Do
Else
Adodc1.Recordset.MoveNext
End If
Loop
End If
If Not (KeyAscii >= Asc("0") & Chr(13) _
And KeyAscii <= Asc("9") & Chr(13) _
Or KeyAscii = vbKeyBack _
Or KeyAscii = vbKeyDelete _
Or KeyAscii = vbKeySpace) Then
Beep
KeyAscii = 0
End If
End Sub

More Related Content

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Tugas pemrograman vb6 pengetikan coding pada form front office

  • 1. Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014 STMIK MIC Cikarang Halaman - 1 Pengetikan Coding pada Form Front Office : Tombol : Tambah Private Sub Command1_Click(Index As Integer) Text1.SetFocus Adodc1.Recordset.AddNew pesan = MsgBox("Anda mau menambah data?", vbInformation, "Informasi") Text1.Text = "" Text2.Text = "" Combo1.Text = "" Combo2.Text = "" Adodc1.Recordset!nip = "" Adodc1.Recordset!nama_peg = "" Adodc1.Recordset!shift = "" Adodc1.Recordset!Status = "" End Sub Tombol : Simpan Private Sub command2_Click(Index As Integer) Adodc1.Recordset.Fields("nip") = Text1.Text Adodc1.Recordset.Fields("nama_peg") = Text2.Text Adodc1.Recordset.Fields("shift") = Combo1.Text Adodc1.Recordset.Fields("status") = Combo2.Text MsgBox "Data sudah disimpan" Text1.Text = "" Text2.Text = "" Combo1.Text = "" Combo2.Text = "" End Sub
  • 2. Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014 STMIK MIC Cikarang Halaman - 2 Tombol : Edit Private Sub Command3_Click(Index As Integer) Adodc1.Recordset!nip = Text1.Text Adodc1.Recordset!nama_peg = Text2.Text Adodc1.Recordset!shift = Combo1.Text Adodc1.Recordset!Status = Combo2.Text Adodc1.Recordset.Update MsgBox "Data sudah diubah" End Sub Tombol : Hapus Private Sub Command4_Click(Index As Integer) Adodc1.Recordset.Delete Text1.Text = "" Text2.Text = "" Combo1.Text = "" Combo2.Text = "" MsgBox "Data sudah dihapus" Adodc1.Refresh End Sub Tombol : Batal Private Sub Command5_Click(Index As Integer) Text1.Text = "" Text2.Text = "" Combo1.Text = "" Combo2.Text = "" End Sub Tombol : Tutup Private Sub Command6_Click(Index As Integer) Unload Me End Sub Datagrid (klik 2x) : Private Sub DataGrid1_Click() Text1 = Adodc1.Recordset!nip Text2 = Adodc1.Recordset!nama_peg Combo1 = Adodc1.Recordset!shift Combo2 = Adodc1.Recordset!Status End Sub Coding di Form Load untuk menampilkan Combo1 dan Combo2 : Private Sub Form_Load() Combo1.Clear Combo1.AddItem "1" Combo1.AddItem "2" Combo2.Clear
  • 3. Tugas Pemrograman VB-6 (Asep Jalaludin,S.T.,M.M.) Tanggal : 14 April 2014 STMIK MIC Cikarang Halaman - 3 Combo2.AddItem "Tetap" Combo2.AddItem "Tidak Tetap" End Sub Text1.text (Klik 2x) : Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Adodc1.Recordset.MoveFirst Do While Not Adodc1.Recordset.EOF If Adodc1.Recordset!nip = Text1.Text Then MsgBox "Data ditemukan" Text2 = Adodc1.Recordset!nama_peg Combo1 = Adodc1.Recordset!shift Combo2 = Adodc1.Recordset!Status Exit Do Else Adodc1.Recordset.MoveNext End If Loop End If If Not (KeyAscii >= Asc("0") & Chr(13) _ And KeyAscii <= Asc("9") & Chr(13) _ Or KeyAscii = vbKeyBack _ Or KeyAscii = vbKeyDelete _ Or KeyAscii = vbKeySpace) Then Beep KeyAscii = 0 End If End Sub