Aplikasi Perhitungan Kelayakan Usaha Berbasis Visual Basic 6.0

LISTING PROGRAM

Source code form Login
Option Explicit
Public rslogin As ADODB.Recordset
Private Sub cmdCancel_Click()
Dim pil As VbMsgBoxResult
pil = MsgBox("Anda Yakin untuk keluar?", vbQuestion +
vbYesNo, "Exit")
If (pil = vbYes) Then
Unload Me
End If
End Sub
Private Sub cmdOK_Click()
Call koneksi
If txtpass.Text "" Or txtpass.Text = "password" Then
Dim sqlopen As String
sqlopen = "select * from Login where password='" &
txtpass.Text & "'"
Conn.Execute sqlopen
frmStartup.Show

End If
End Sub
Private Sub Form_Load()
Call koneksi
End Sub

Universitas Sumatera Utara

Source code form menu startup
Dim ket As String
Private Sub cmdNext_Click()
frmTutorial.Visible = True
End Sub
Private Sub cmdNextSkip_Click()
MenuReg.Show
MenuReg.WindowState = Center
frmStartup.Visible = True
frmLogin.Visible = False
frmTutorial.Visible = False
End Sub

Private Sub Form_Activate()
ket = "

" & Label1.Caption

End Sub
Private Sub Form_Load()
frmTutorial.Visible = False
frmStartup.WindowState = crptMaximized
End Sub
Private Sub mnExit_Click()
Dim X As Integer
Dim Y As Integer
X = MsgBox("Apakah Anda yakin ingin keluar??", vbYesNo,
"Konfirmasi")
If X = vbYes Then

Universitas Sumatera Utara

Y = MsgBox("Thank You !", vbYes, "Konfirmasi")

End
End If
End Sub
Private Sub Timer1_Timer()
ket = Right(ket, Len(ket) - 1) & Left(ket, 1)
Label1.Caption = ket
End Sub

Source code form menu registrasi
Private Sub cmdBEP_Click()
BEP_Gadget.WindowState = Center
BEP_Kuliner.WindowState = Center
MenuReg.Visible = False
Call koneksi
If txtNU.Text = "" Or cboBU.Text = "" Or cboMU.Text = ""
Then
MsgBox "Ada Data Yang Belum Diisi...!," & vbCrLf & "" _
& "Mohon Data Dilengkapi Dulu", vbCritical,
"Peringatan!"
MenuReg.Visible = True

Exit Sub
ElseIf cboBU.Text = "Bisnis KuLiner" Or cboBU.Text =
"Bisnis Laundry" Then
Dim sqlAdd2 As String

Universitas Sumatera Utara

sqlAdd2 = " insert into BEP2 (Nama_Usaha, Bidang_Usaha,
Model_Usaha) values ('" & txtNU.Text & "' , '" &
cboBU.Text & "' , '" & cboMU.Text & "')"
Conn.Execute (sqlAdd2)
BEP_Kuliner.Show
ElseIf cboBU.Text = "Bisnis Gadget" Or cboBU.Text =
"Bisnis Pulsa" Then
Dim sqlAdd1 As String
sqlAdd1 = " insert into BEP1 (Nama_Usaha, Bidang_Usaha,
Model_Usaha) values ('" & txtNU.Text & "' , '" &
cboBU.Text & "' , '" & cboMU.Text & "')"
Conn.Execute (sqlAdd1)
BEP_Gadget.Show

Else
Dim sqlAdd As String
sqlAdd = "insert into BEP (Nama_Usaha, Bidang_Usaha,
Model_Usaha) values ('" & txtNU.Text & "' , '" &
cboBU.Text & "' , '" & cboMU.Text & "')"
Conn.Execute (sqlAdd)
BEP.Show
End If
End Sub
Private Sub cmdClear_Click()
txtNU.Text = ""
cboBU.Text = ""
cboMU.Text = ""
txtNU.SetFocus
End Sub

Universitas Sumatera Utara

Private Sub cmdPBP_Click()
MenuReg.Visible = False

Call koneksi
If txtNU.Text = "" Or cboBU.Text = "" Or cboMU.Text = ""
Then
MsgBox "Ada Data Yang Belum Diisi...!," & vbCrLf & "" _
& "Mohon Data Dilengkapi Dulu", vbCritical,
"Peringatan!"
MenuReg.Visible = True
Exit Sub
Else
Dim sql As String
Dim sqlAdd As String
sqlAdd = "insert into PBP (Nama_Usaha, Bidang_Usaha,
Model_Usaha) values ('" & txtNU.Text & "' , '" &
cboBU.Text & "' , '" & cboMU.Text & "')"
Conn.Execute (sqlAdd)
PBP.Show
End If
End Sub
Private Sub Form_Activate()
txtNU.Text = ""

cboBU.Text = ""
cboMU.Text = ""
txtNU.SetFocus
End Sub
Private Sub Form_Load()

Universitas Sumatera Utara

cboBU.AddItem "Bisnis Advertising"
cboBU.AddItem "Bisnis Gadget"
cboBU.AddItem "Bisnis KuLiner"
cboBU.AddItem "Bisnis Laundry"
cboBU.AddItem "Bisnis Pulsa"
cboBU.AddItem "Jasa"
cboBU.AddItem "Manufaktur Barang"
cboBU.ListIndex = 0
cboMU.AddItem "Industri Perorangan"
cboMU.AddItem "Industri Perusahaan"
cboMU.ListIndex = 0
End Sub

Private Sub mnBEP_Click()
CrystalReport1.Connect = "dsn=Laporan_BEP"
CrystalReport1.WindowState = crptMaximized
CrystalReport1.ReportFileName = App.Path & "\Report1.rpt"
CrystalReport1.Action = 1
End Sub
Private Sub mnExit_Click()
Dim X As Integer
Dim Y As Integer
X = MsgBox("Apakah Anda yakin ingin keluar??", vbYesNo,
"Konfirmasi")
If X = vbYes Then
Y = MsgBox("Thank You !", vbYes, "Konfirmasi")
End
End If
End Sub
Private Sub mnHome_Click()

Universitas Sumatera Utara


frmStartup.Show
End Sub
Private Sub mnPBP_Click()
CrystalReport1.Connect = "dsn=Penjualan_PBP"
CrystalReport1.WindowState = crptMaximized
CrystalReport1.ReportFileName = App.Path &
"\Laporan1.rpt"
CrystalReport1.Action = 1
End Sub

Source code form BEP
Dim X As Long
Private Sub cmdHapus_Click()
txtBBBL.Text = ""
txtBTKL.Text = ""
txtPRencana.Text = ""
txtBV.Text = ""
txtHJ.Text = ""
txtTotal.Text = ""
txtBT.Text = ""

txtLabaUsaha.Text = ""
lblHasil.Caption = ""
lblHasil3.Caption = ""
txtKontribusi.Text = ""
lblHasil2.Caption = ""
txtResult.Text = ""
txtBBBL.SetFocus
End Sub

Universitas Sumatera Utara

Private Sub cmdKeluar_Click()
MenuReg.Visible = True
Unload Me
End Sub
Private Sub cmdHitung2_Click()
lblHasil2.Caption = (Val(txtTotal.Text) Val(lblHasil.Caption))
If Val(txtTotal.Text) > Val(txtBT.Text) Then
txtResult.Text = "Perusahaan Anda akan memperoleh Laba"
MsgBox "Rencana USAHA Anda akan memperoleh Laba sebesar

Rp " _
& txtLabaUsaha.Text & " serta berada pada titik impas
(BEP) sebesar Rp " _
& lblHasil.Caption & " Namun, batas minimum penjualan
yang bisa ditolerir sebesar Rp " _
& lblHasil2.Caption & " agar Perusahaan Anda Layak
Beroperasi", vbInformation, "Congrats!"
ElseIf Val(txtTotal.Text) < Val(txtBT.Text) Then
txtResult.Text = "Perusahaan Anda tidak memperoleh Laba"
MsgBox "Rencana USAHA Anda tidak memperoleh Laba karena
Hasil penjualan yaitu Rp " _
& txtTotal.Text & " Lebih sedikit dari biaya tetap
sebesar Rp " _
& txtBT.Text & " pada rencana penjualan", vbInformation,
"HeLP"
Else
txtResult.Text = "Usaha Anda akan berada pada titik
Impas"
MsgBox " Usaha Anda berada pada titik impas karena besar
penjualan tepat berada pada Rp " _

Universitas Sumatera Utara

& lblHasil.Caption & " sehingga perusahaan tidak UNTUNG
dan juga RUGI", vbInformation, "Note"
End If
End Sub
Private Sub cmdSimpan_Click()
If txtBBBL.Text = "" Or txtBTKL.Text = "" Or
txtPRencana.Text = "" Or txtHJ.Text = "" Or txtBT.Text =
"" Then
MsgBox "Data yang diisi belum lengkap"
Exit Sub
Else
Dim sqlUpdate As String
sqlUpdate = "update BEP set Biaya_BBakuLangsung='" &
txtBBBL.Text & "', Biaya_TKerjaLangsung='" & txtBTKL.Text
& "', P_Rencana='" & txtPRencana.Text & "',
Biaya_Variabel='" & txtBV.Text & "', Harga_Jual='" &
txtHJ.Text & "', Total='" & txtTotal.Text &
"',Biaya_Tetap='" & txtBT.Text & "', Laba='" &
txtLabaUsaha.Text & "', P_BEPrupiah='" & lblHasil.Caption
& "', P_BEPunit='" & lblHasil3.Caption & "',
Kontribusi_Margin='" & txtKontribusi.Text & "', MOS='" &
lblHasil2.Caption & "', Kesimpulan='" & txtResult.Text &
"'"
Conn.Execute sqlUpdate
End If
End Sub
Private Sub Form_Load()
Call koneksi
End Sub
Private Sub mnAwal_Click()

Universitas Sumatera Utara

MenuReg.Show
End Sub
Private Sub txtBT_Change()
On Error Resume Next
X = (Val(txtBT.Text) / (1 - (Val(txtBV.Text) /
Val(txtTotal.Text))))
lblHasil.Caption = X
lblHasil3.Caption = X / Val(txtHJ.Text)
txtLabaUsaha.Text = Val(txtKontribusi.Text) Val(txtBT.Text)
End Sub
Private Sub txtHJ_Change()
txtTotal.Text = Val(txtPRencana.Text) * Val(txtHJ.Text)
End Sub
Private Sub txtPRencana_Change()
txtBV.Text = (Val(txtBBBL.Text) + Val(txtBTKL.Text)) *
Val(txtPRencana.Text)
End Sub
Private Sub txtTotal_Change()
txtKontribusi.Text = Val(txtTotal.Text) - Val(txtBV.Text)
End Sub

Source code form BEP_Gadget
Dim X As Long
Private Sub cmdCalculate_Click()

Universitas Sumatera Utara

lblHasil2.Caption = (Val(txtPRencana.Text) Val(txtBE.Text))
If Val(txtPRencana.Text) > Val(txtBE.Text) Then
txtResult.Text = "Penjualan yang direncanakan Lebih besar
dari perhitungan BEP"
MsgBox " Usaha Anda akan layak jika Anda mampu
merealisasikan penjualan sesuai rencana Anda yaitu
sebesar " _
& txtPRencana.Text & " unit", vbOKOnly, "Congrats!"
ElseIf Val(txtPRencana.Text) < Val(txtBE.Text) Then
txtResult.Text = "Penjualan yang direncanakan lebih
sedikit dari perhitungan BEP"
MsgBox "Harap cek ulang Perincian biaya Anda! Usahakan
agar hasil perhitungan Penjualan melalui BEP sebesar " _
& txtBE.Text & " unit, Lebih sedikit dari Rencana
Penjualan Anda", vbInformation, "HeLP"
Else
txtResult.Text = "Usaha Anda Berada pada titik Impas"
MsgBox " Usaha Anda berada pada titik impas karena besar
penjualan tepat berada pada " _
& txtBE.Text & " unit, sehingga perusahaan tidak UNTUNG
dan juga RUGI", vbInformation, "Note"
End If
End Sub
Private Sub cmdHapus_Click()
txtBT.Text = ""
txtBV.Text = ""
txtHJ.Text = ""
txtLaba.Text = ""
lblHasil.Caption = ""
lblHasil3.Caption = ""

Universitas Sumatera Utara

txtPRencana.Text = ""
txtBE.Text = ""
lblHasil2.Caption = ""
txtResult.Text = ""
txtBT.SetFocus
End Sub
Private Sub cmdKeluar_Click()
MenuReg.Visible = True
Unload Me
End Sub

Private Sub cmdSimpan_Click()
If txtBT.Text = "" Or txtBV.Text = "" Or txtHJ.Text = ""
Or txtLaba.Text = "" Or txtPRencana.Text = "" Then
MsgBox "Data yang diisi belum lengkap"
Exit Sub
Else
Dim sqlUpdate As String
sqlUpdate = "update BEP1 set Biaya_Tetap='" & txtBT.Text
& "', Biaya_Variabel='" & txtBV.Text & "', Harga_Jual='"
& txtHJ.Text & "', R_Laba='" & txtLaba.Text & "',
BEPRupiah='" & lblHasil.Caption & "', BEPUnit='" &
lblHasil3.Caption & "', P_Rencana='" & txtPRencana.Text &
"', P_BEP='" & txtBE.Text & "', Batas_Penjualan='" &
lblHasil2.Caption & "', Calculate='" & txtResult.Text &
"'"
Conn.Execute sqlUpdate
End If
End Sub

Universitas Sumatera Utara

Private Sub Form_Load()
Call koneksi
End Sub
Private Sub txtLaba_Change()
On Error Resume Next
X = (Val(txtBT.Text) / ((1 - (Val(txtBV.Text) /
Val(txtHJ.Text))) - (Val(txtLaba.Text) / 100)))
lblHasil.Caption = X
lblHasil3.Caption = X / Val(txtHJ.Text)
txtBE.Text = lblHasil3.Caption
End Sub

Source code form BEP_Kuliner
Private Sub cmdHapus_Click()
txtSewa.Text = ""
txtGaji.Text = ""
txtP_BPerlengkapan.Text = ""
txtP_BiayaBB.Text = ""
txtBV.Text = ""
txtBT.Text = ""
txtTotalBO.Text = ""
txtHJ.Text = ""
txtR_P.Text = ""
txtTPemasukan.Text = ""
txtLaba.Text = ""
txtBE.Text = ""

Universitas Sumatera Utara

lblHasil2.Caption = ""
txtResult.Text = ""
txtSewa.SetFocus
End Sub
Private Sub cmdHitung2_Click()
lblHasil2.Caption = (Val(txtR_P.Text) - Val(txtBE.Text))
If Val(txtR_P.Text) > Val(txtBE.Text) Then
txtResult.Text = "Penjualan yang direncanakan Lebih besar
dari perhitungan BEP"
MsgBox " Usaha Anda akan layak jika Anda mampu
merealisasikan penjualan sesuai rencana Anda yaitu
sebesar " _
& txtR_P.Text & " unit", vbOKOnly, "Congrats!"
ElseIf Val(txtR_P.Text) < Val(txtBE.Text) Then
txtResult.Text = "Penjualan yang direncanakan lebih
sedikit dari perhitungan BEP"
MsgBox "Harap cek ulang Perincian biaya Anda! Usahakan
agar hasil perhitungan Penjualan melalui BEP sebesar " _
& txtBE.Text & " unit, Lebih sedikit dari Rencana
Penjualan Anda", vbInformation, "HeLP"
Else
txtResult.Text = "Usaha Anda Berada pada titik Impas"
MsgBox " Usaha Anda berada pada titik impas karena besar
penjualan tepat berada pada " _
& txtBE.Text & " unit, sehingga perusahaan tidak UNTUNG
dan juga RUGI", vbInformation, "Note"
End If
End Sub
Private Sub cmdKeluar_Click()

Universitas Sumatera Utara

MenuReg.Visible = True
Unload Me
End Sub
Private Sub cmdSimpan_Click()
Dim sqlUpdate As String
sqlUpdate = "update BEP2 set Biaya_Sewa='" & txtSewa.Text
& "', Gaji='" & txtGaji.Text & "', Biaya_Perlengkapan='"
& txtP_BPerlengkapan & "', Biaya_BB='" & txtP_BiayaBB &
"', Biaya_Variabel='" & txtBV.Text & "', Biaya_Tetap='" &
txtBT.Text & "', Biaya_Operasional='" & txtTotalBO.Text &
"', Harga_Jual='" & txtHJ.Text & "', R_Penjualan='" &
txtR_P.Text & "', Total='" & txtTPemasukan.Text & "',
Laba='" & txtLaba.Text & "', P_BEP='" & txtBE.Text & "',
MOS='" & lblHasil2.Caption & "', Result='" &
txtResult.Text & "'"
Conn.Execute sqlUpdate
End Sub
Private Sub Form_Load()
Call koneksi
End Sub
Private Sub txtP_BiayaBB_Change()
txtBV.Text = Val(txtP_BiayaBB.Text) + Val(txtSewa.Text)
txtTotalBO.Text = Val(txtBV.Text) + Val(txtBT.Text)
End Sub
Private Sub txtP_BPerlengkapan_Change()
txtBT.Text = Val(txtGaji.Text) +
Val(txtP_BPerlengkapan.Text)
End Sub

Universitas Sumatera Utara

Private Sub txtR_P_Change()
txtTPemasukan.Text = Val(txtR_P.Text) * Val(txtHJ.Text)
On Error Resume Next
txtBE.Text = (Val(txtBT.Text) / ((1 - (Val(txtBV.Text) /
Val(txtHJ.Text))) - (Val(txtLaba.Text) / 100)))
End Sub
Private Sub txtTPemasukan_Change()
txtLaba.Text = Val(txtTPemasukan.Text) Val(txtTotalBO.Text)
End Sub

Source code form PBP
Private Sub cmdClear_Click()
txtInves.Text = ""
txtKas.Text = ""
Cbo1.Text = ""
lblHasil.Caption = ""
lblComent.Caption = ""
txtInves.SetFocus
End Sub
Private Sub cmdExit_Click()
MenuReg.Visible = True
Unload Me
End Sub
Private Sub cmdHitung_Click()
lblHasil.Caption = (txtInves.Text / txtKas.Text) * 1

Universitas Sumatera Utara

If Val(lblHasil.Caption)