home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 May
/
W2KPRK.iso
/
apps
/
crystal
/
disk18
/
Xvb369._
/
Xvb369.
(
.txt
)
Wrap
Visual Basic Form
|
1999-08-23
|
12KB
|
381 lines
VERSION 5.00
Begin VB.Form frmEmployee
BorderStyle = 3 'Fixed Dialog
Caption = "Employee"
ClientHeight = 4575
ClientLeft = 330
ClientTop = 780
ClientWidth = 7785
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4575
ScaleWidth = 7785
ShowInTaskbar = 0 'False
Tag = "Employee"
Begin VB.CommandButton cmdClose
Cancel = -1 'True
Caption = "&Close"
Default = -1 'True
Height = 300
Left = 5535
TabIndex = 25
Top = 3870
Width = 975
End
Begin VB.CommandButton cmdGrid
Caption = "&Grid"
Height = 300
Left = 4455
TabIndex = 24
Tag = "&Grid"
Top = 3870
Width = 975
End
Begin VB.CommandButton cmdUpdate
Caption = "&Update"
Height = 300
Left = 3375
TabIndex = 23
Tag = "&Update"
Top = 3870
Width = 975
End
Begin VB.CommandButton cmdRefresh
Caption = "&Refresh"
Height = 300
Left = 2280
TabIndex = 22
Tag = "&Refresh"
Top = 3870
Width = 975
End
Begin VB.CommandButton cmdDelete
Caption = "&Delete"
Height = 300
Left = 1200
TabIndex = 21
Tag = "&Delete"
Top = 3870
Width = 975
End
Begin VB.CommandButton cmdAdd
Caption = "&Add"
Height = 300
Left = 120
TabIndex = 20
Tag = "&Add"
Top = 3870
Width = 975
End
Begin VB.Data Data1
Align = 2 'Align Bottom
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 345
Left = 0
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "Employee"
Top = 4230
Width = 7785
End
Begin VB.TextBox txtFields
DataField = "Notes"
DataSource = "Data1"
Height = 855
Index = 9
Left = 120
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 19
Top = 2880
Width = 4305
End
Begin VB.TextBox txtFields
DataField = "Extension"
DataSource = "Data1"
Height = 285
Index = 7
Left = 1320
MaxLength = 4
TabIndex = 15
Top = 2280
Width = 3120
End
Begin VB.TextBox txtFields
DataField = "Home Phone"
DataSource = "Data1"
Height = 285
Index = 6
Left = 1320
MaxLength = 20
TabIndex = 13
Top = 1960
Width = 3120
End
Begin VB.TextBox txtFields
DataField = "Hire Date"
DataSource = "Data1"
Height = 285
Index = 5
Left = 1320
TabIndex = 11
Top = 1640
Width = 1680
End
Begin VB.TextBox txtFields
DataField = "Birth Date"
DataSource = "Data1"
Height = 285
Index = 4
Left = 1320
TabIndex = 9
Top = 1320
Width = 1680
End
Begin VB.TextBox txtFields
DataField = "Position"
DataSource = "Data1"
Height = 285
Index = 3
Left = 1320
MaxLength = 30
TabIndex = 7
Top = 1000
Width = 3120
End
Begin VB.TextBox txtFields
DataField = "First Name"
DataSource = "Data1"
Height = 285
Index = 2
Left = 1320
MaxLength = 10
TabIndex = 5
Top = 680
Width = 3120
End
Begin VB.TextBox txtFields
DataField = "Last Name"
DataSource = "Data1"
Height = 285
Index = 1
Left = 1320
MaxLength = 20
TabIndex = 3
Top = 360
Width = 3120
End
Begin VB.TextBox txtFields
DataField = "Employee ID"
DataSource = "Data1"
Height = 285
Index = 0
Left = 1320
TabIndex = 1
Top = 40
Width = 1680
End
Begin VB.Label lblLabels
Caption = "Notes:"
Height = 255
Index = 9
Left = 120
TabIndex = 18
Tag = "Notes:"
Top = 2625
Width = 1815
End
Begin VB.OLE oleFields
DataField = "Photo"
DataSource = "Data1"
Height = 3435
Index = 8
Left = 4650
OLETypeAllowed = 1 'Embedded
SizeMode = 3 'Zoom
TabIndex = 17
Top = 315
Width = 2970
End
Begin VB.Label lblLabels
Caption = "Photo:"
Height = 255
Index = 8
Left = 4650
TabIndex = 16
Tag = "Photo:"
Top = 60
Width = 1815
End
Begin VB.Label lblLabels
Caption = "Extension:"
Height = 255
Index = 7
Left = 120
TabIndex = 14
Tag = "Extension:"
Top = 2295
Width = 1125
End
Begin VB.Label lblLabels
Caption = "Home Phone:"
Height = 255
Index = 6
Left = 120
TabIndex = 12
Tag = "Home Phone:"
Top = 1980
Width = 1125
End
Begin VB.Label lblLabels
Caption = "Hire Date:"
Height = 255
Index = 5
Left = 120
TabIndex = 10
Tag = "Hire Date:"
Top = 1665
Width = 1125
End
Begin VB.Label lblLabels
Caption = "Birth Date:"
Height = 255
Index = 4
Left = 120
TabIndex = 8
Tag = "Birth Date:"
Top = 1335
Width = 1125
End
Begin VB.Label lblLabels
Caption = "Position:"
Height = 255
Index = 3
Left = 120
TabIndex = 6
Tag = "Position:"
Top = 1020
Width = 1125
End
Begin VB.Label lblLabels
Caption = "First Name:"
Height = 255
Index = 2
Left = 120
TabIndex = 4
Tag = "First Name:"
Top = 705
Width = 1125
End
Begin VB.Label lblLabels
Caption = "Last Name:"
Height = 255
Index = 1
Left = 120
TabIndex = 2
Tag = "Last Name:"
Top = 375
Width = 1125
End
Begin VB.Label lblLabels
Caption = "Employee ID:"
Height = 255
Index = 0
Left = 120
TabIndex = 0
Tag = "Employee ID:"
Top = 60
Width = 1125
End
Attribute VB_Name = "frmEmployee"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdAdd_Click()
Data1.Recordset.AddNew
End Sub
Private Sub cmdClose_Click()
Me.Hide
End Sub
Private Sub cmdDelete_Click()
'this may produce an error if you delete the last
'record or the only record in the recordset
With Data1.Recordset
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
End Sub
Private Sub cmdRefresh_Click()
'this is really only needed for multi user apps
Data1.Refresh
End Sub
Private Sub cmdUpdate_Click()
Data1.UpdateRecord
Data1.Recordset.Bookmark = Data1.Recordset.LastModified
End Sub
Private Sub cmdGrid_Click()
On Error GoTo cmdGrid_ClickErr
Dim f As New frmDataGrid
Set f.Data1.Recordset = Data1.Recordset
f.Caption = Me.Caption & " Grid"
f.Show
Exit Sub
cmdGrid_ClickErr:
End Sub
Private Sub Data1_Error(DataErr As Integer, Response As Integer)
'This is where you would put error handling code
'If you want to ignore errors, comment out the next line
'If you want to trap them, add code here to handle them
MsgBox "Data error event hit err:" & Error$(DataErr)
Response = 0 'throw away the error
End Sub
Private Sub Data1_Reposition()
Screen.MousePointer = vbDefault
On Error Resume Next
'This will display the current record position
'for dynasets and snapshots
Data1.Caption = "Record: " & (Data1.Recordset.AbsolutePosition + 1)
'for the table object you must set the index property when
'the recordset gets created and use the following line
'Data1.Caption = "Record: " & (Data1.Recordset.RecordCount * (Data1.Recordset.PercentPosition * 0.01)) + 1
End Sub
Private Sub Data1_Validate(Action As Integer, Save As Integer)
'This is where you put validation code
'This event gets called when the following actions occur
Select Case Action
Case vbDataActionMoveFirst
Case vbDataActionMovePrevious
Case vbDataActionMoveNext
Case vbDataActionMoveLast
Case vbDataActionAddNew
Case vbDataActionUpdate
Case vbDataActionDelete
Case vbDataActionFind
Case vbDataActionBookmark
Case vbDataActionClose
Screen.MousePointer = vbDefault
End Select
Screen.MousePointer = vbHourglass
End Sub
Private Sub Form_Load()
Center Me
Me.Data1.DatabaseName = frmMain.gsDatabase
End Sub
Private Sub Form_Unload(Cancel As Integer)
Screen.MousePointer = vbDefault
End Sub
Private Sub oleFields_DblClick(Index As Integer)
'this is the way to get data into an empty ole control
'and have it saved back to the table
oleFields(Index).InsertObjDlg
End Sub