Sie sind auf Seite 1von 11

Form1 - 1

Option Explicit

Private Sub cmdAdd_Click()


frmNew.Show 1
End Sub

Private Sub cmdDelete_Click()


If Me.ListView.ListItems.Count = 0 Then
MsgBox "There are no records to modify or delete!", vbExclamation, "Error"
Exit Sub
End If

If MsgBox("Are you sure you want to delete the selected record?", vbYesNo, "Delete") = vbYes Then
Call dbConnect
Conn.Execute "Delete * from tbl_info where id_info=" & Val(Me.ListView.SelectedItem.Text) & ""
Conn.Close
Set Conn = Nothing
Me.ListView.ListItems.Remove (Me.ListView.SelectedItem.Index)
MsgBox "The selected record was deleted", vbExclamation, "Delete"
Else
Cancel = True
End If
End Sub

Private Sub cmdEdit_Click()


If Me.ListView.ListItems.Count = 0 Then
MsgBox "There are no records to modify or delete!", vbExclamation, "Error"
Exit Sub
End If
frmEdit.Show 1
End Sub

Private Sub cmdRefresh_Click()


Call loadRecords
End Sub

Private Sub cmdSearch_Click()


frmSearch.Show 1
End Sub

Private Sub Form_Load()


Call loadRecords
End Sub

Private Sub Form_Unload(Cancel As Integer)


Dim Form As Form

For Each Form In Forms


Unload Form
DoEvents
Next
End Sub
Form1 - 1

VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{BA0F0D53-DEAE-44A6-B2FD-31C81438FAF1}#1.0#0"; "WelchButton.ocx"
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "Add, Edit, Delete and Search"
ClientHeight = 5115
ClientLeft = 45
ClientTop = 330
ClientWidth = 6855
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5115
ScaleWidth = 6855
StartUpPosition = 2 'CenterScreen
Begin WelchButton.lvButtons_H cmdAdd
Height = 375
Left = 120
TabIndex = 1
Top = 4560
Width = 1215
_ExtentX = 2143
_ExtentY = 661
Caption = "&Add"
CapAlign = 2
BackStyle = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
cGradient = 0
Mode = 0
Value = 0 'False
Image = {Binary}
cBack = -2147483633
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 1320
Top = 5160
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = <...>
OLEDBString = <...>
OLEDBFile = ""
Form1 - 2

DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSComctlLib.ListView ListView
Height = 4215
Left = 120
TabIndex = 0
Top = 120
Width = 6615
_ExtentX = 11668
_ExtentY = 7435
View = 3
LabelWrap = -1 'True
HideSelection = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
NumItems = 3
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "DB ID"
Object.Width = 1411
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "NAME"
Object.Width = 4410
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "ADDRESS"
Object.Width = 5292
EndProperty
End
Begin WelchButton.lvButtons_H cmdEdit
Height = 375
Left = 1440
TabIndex = 2
Top = 4560
Width = 1215
_ExtentX = 2143
_ExtentY = 661
Caption = "&Edit"
CapAlign = 2
BackStyle = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Form1 - 3

Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
cGradient = 0
Mode = 0
Value = 0 'False
Image = {Binary}
cBack = -2147483633
End
Begin WelchButton.lvButtons_H cmdDelete
Height = 375
Left = 2760
TabIndex = 3
Top = 4560
Width = 1215
_ExtentX = 2143
_ExtentY = 661
Caption = "&Delete"
CapAlign = 2
BackStyle = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
cGradient = 0
Mode = 0
Value = 0 'False
Image = {Binary}
cBack = -2147483633
End
Begin WelchButton.lvButtons_H cmdSearch
Height = 375
Left = 5520
TabIndex = 4
Top = 4560
Width = 1215
_ExtentX = 2143
_ExtentY = 661
Caption = "&Search"
CapAlign = 2
BackStyle = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
cGradient = 0
Mode = 0
Value = 0 'False
Image = {Binary}
cBack = -2147483633
End
Begin WelchButton.lvButtons_H cmdRefresh
Height = 375
Left = 4200
TabIndex = 5
Top = 4560
Width = 1215
_ExtentX = 2143
_ExtentY = 661
Form1 - 4

Caption = "&Refresh"
CapAlign = 2
BackStyle = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
cGradient = 0
Mode = 0
Value = 0 'False
Image = {Binary}
cBack = -2147483633
End
End
frmEdit - 1

Option Explicit

Private Sub cmdAd


On Error GoTo e

If Me.txtName.T
MsgBox "All f
Exit Sub
End If
frmEdit - 1

VERSION 5.00
Object = "{BA0F0D53-DEAE-44A6-B2FD-31C81438FAF1}#1.0#0"; "WelchButton.ocx"
Begin VB.Form frmEdit
BorderStyle = 1 'Fixed Single
Caption = "Edit Entry"
ClientHeight = 1530
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1530
ScaleWidth = 4680
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox txtName
Height = 330
Left = 1080
TabIndex = 0
Top = 240
Width = 3495
End
Begin VB.TextBox txtAdd
Height = 330
Left = 1080
TabIndex = 1
Top = 600
Width = 3495
End
Begin WelchButton.lvButtons_H cmdAdd
Default = -1 'True
Height = 375
Left = 3360
TabIndex = 2
Top = 1080
Width = 1215
_ExtentX = 2143
_ExtentY = 661
Caption = "&Save"
CapAlign = 2
BackStyle = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
cGradient = 0
Mode = 0
Value = 0 'False
cBack = -2147483633
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Name:"
Height = 225
Left = 120
TabIndex = 4
Top = 300
Width = 555
End
frmEdit - 2

Begin VB.Label Label2


AutoSize = -1 'True
Caption = "Address:"
Height = 225
Left = 120
TabIndex = 3
Top = 660
Width = 735
End
End
Name:

Address:
frmLoading - 1

Option Explicit

Private Declare F
As Long, ByVal w
Private Declare S
Const WM_NCLBUTTO
Const HTCAPTION =

Private Sub Form_


onTop.MakeTopMo

Das könnte Ihnen auch gefallen