home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Buyer 1998 October
/
dpcb1098.iso
/
Business
/
Maxim
/
MAX5
/
data.z
/
Persform.frm
< prev
next >
Wrap
Text File
|
1998-05-10
|
21KB
|
682 lines
VERSION 5.00
Begin VB.Form Persform
Caption = "Maximizer Address Book (ODBC Version)"
ClientHeight = 5220
ClientLeft = 60
ClientTop = 345
ClientWidth = 8550
LinkTopic = "Form1"
ScaleHeight = 5220
ScaleWidth = 8550
StartUpPosition = 1 'CenterOwner
Begin VB.TextBox EntryType
Enabled = 0 'False
Height = 285
Left = 5400
MaxLength = 21
TabIndex = 51
Top = 3480
Width = 2175
End
Begin VB.CommandButton Command6
Caption = "&Previous"
Height = 375
Left = 120
TabIndex = 49
Top = 4560
Width = 1095
End
Begin VB.CommandButton Command5
Caption = "Ne&xt"
Height = 375
Left = 1440
TabIndex = 48
Top = 4560
Width = 1095
End
Begin VB.CommandButton Command4
Caption = "&Delete"
Default = -1 'True
Height = 375
Left = 6120
TabIndex = 47
Top = 4560
Width = 1095
End
Begin VB.CommandButton Command3
Caption = "&Update"
Height = 375
Left = 4920
TabIndex = 46
Top = 4560
Width = 1095
End
Begin VB.TextBox ID
Enabled = 0 'False
Height = 285
Left = 5400
MaxLength = 23
TabIndex = 31
Top = 1680
Width = 2175
End
Begin VB.TextBox Phone4Ext
Height = 285
Left = 7680
MaxLength = 5
TabIndex = 43
Top = 3120
Width = 735
End
Begin VB.TextBox Phone4
Height = 285
Left = 5400
MaxLength = 21
TabIndex = 42
Top = 3120
Width = 2175
End
Begin VB.TextBox Phone3Ext
Height = 285
Left = 7680
MaxLength = 5
TabIndex = 40
Top = 2760
Width = 735
End
Begin VB.TextBox Phone3
Height = 285
Left = 5400
MaxLength = 21
TabIndex = 39
Top = 2760
Width = 2175
End
Begin VB.TextBox Phone2Ext
Height = 285
Left = 7680
MaxLength = 5
TabIndex = 37
Top = 2400
Width = 735
End
Begin VB.TextBox Phone2
Height = 285
Left = 5400
MaxLength = 21
TabIndex = 36
Top = 2400
Width = 2175
End
Begin VB.TextBox Phone1Ext
Height = 285
Left = 7680
MaxLength = 5
TabIndex = 34
Top = 2040
Width = 735
End
Begin VB.TextBox Phone1
Height = 285
Left = 5400
MaxLength = 21
TabIndex = 33
Top = 2040
Width = 2175
End
Begin VB.TextBox Country
Height = 285
Left = 5400
MaxLength = 39
TabIndex = 29
Top = 1320
Width = 2175
End
Begin VB.TextBox Zip
Height = 285
Left = 5400
MaxLength = 19
TabIndex = 27
Top = 960
Width = 2175
End
Begin VB.TextBox State
Height = 285
Left = 5400
MaxLength = 39
TabIndex = 25
Top = 600
Width = 2175
End
Begin VB.TextBox City
Height = 285
Left = 5400
MaxLength = 39
TabIndex = 23
Top = 240
Width = 2175
End
Begin VB.TextBox Address2
Height = 285
Left = 1440
MaxLength = 39
TabIndex = 21
Top = 3840
Width = 2175
End
Begin VB.TextBox Address1
Height = 285
Left = 1440
MaxLength = 39
TabIndex = 19
Top = 3480
Width = 2175
End
Begin VB.TextBox Division
Height = 285
Left = 1440
MaxLength = 39
TabIndex = 17
Top = 3120
Width = 2175
End
Begin VB.TextBox Dept
Height = 285
Left = 1440
MaxLength = 39
TabIndex = 15
Top = 2760
Width = 2175
End
Begin VB.TextBox Company
Height = 285
Left = 1440
MaxLength = 59
TabIndex = 13
Top = 2400
Width = 2175
End
Begin VB.TextBox Salutation
Height = 285
Left = 1440
MaxLength = 39
TabIndex = 11
Top = 2040
Width = 2175
End
Begin VB.TextBox Position
Height = 285
Left = 1440
MaxLength = 59
TabIndex = 9
Top = 1680
Width = 2175
End
Begin VB.TextBox LastName
Height = 285
Left = 1440
MaxLength = 59
TabIndex = 7
Top = 1320
Width = 2175
End
Begin VB.TextBox Initial
Height = 285
Left = 1440
MaxLength = 1
TabIndex = 5
Top = 960
Width = 2175
End
Begin VB.TextBox FirstName
Height = 285
Left = 1440
MaxLength = 39
TabIndex = 3
Top = 600
Width = 2175
End
Begin VB.TextBox Mr
Height = 285
Left = 1440
MaxLength = 39
TabIndex = 1
Top = 240
Width = 2175
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "Close"
Height = 375
Left = 7320
TabIndex = 45
Top = 4560
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "&Add"
Height = 375
Left = 3720
TabIndex = 44
Top = 4560
Width = 1095
End
Begin VB.Label Label21
Caption = "Entry Type"
Enabled = 0 'False
Height = 255
Left = 4080
TabIndex = 50
Top = 3480
Width = 1215
End
Begin VB.Label Label20
Caption = "Phone &4"
Height = 255
Left = 4080
TabIndex = 41
Top = 3120
Width = 1215
End
Begin VB.Label Label19
Caption = "Phone &3"
Height = 255
Left = 4080
TabIndex = 38
Top = 2760
Width = 1215
End
Begin VB.Label Label18
Caption = "Phone &2"
Height = 255
Left = 4080
TabIndex = 35
Top = 2400
Width = 1215
End
Begin VB.Label Label17
Caption = "Phone &1"
Height = 255
Left = 4080
TabIndex = 32
Top = 2040
Width = 1215
End
Begin VB.Label Label16
Caption = "Identification"
Enabled = 0 'False
Height = 255
Left = 4080
TabIndex = 30
Top = 1680
Width = 1215
End
Begin VB.Label Label15
Caption = "Cou&ntry"
Height = 255
Left = 4080
TabIndex = 28
Top = 1320
Width = 1215
End
Begin VB.Label Label14
Caption = "&Zip/Postal"
Height = 255
Left = 4080
TabIndex = 26
Top = 960
Width = 1215
End
Begin VB.Label Label13
Caption = "St&/Prov"
Height = 255
Left = 4080
TabIndex = 24
Top = 600
Width = 1215
End
Begin VB.Label Label12
Caption = "&City"
Height = 255
Left = 4080
TabIndex = 22
Top = 240
Width = 1215
End
Begin VB.Label Label11
Caption = "Addre&ss Line 2"
Height = 255
Left = 120
TabIndex = 20
Top = 3840
Width = 1215
End
Begin VB.Label Label10
Caption = "Add&ress Line 1"
Height = 255
Left = 120
TabIndex = 18
Top = 3480
Width = 1215
End
Begin VB.Label Label9
Caption = "Di&vision"
Height = 255
Left = 120
TabIndex = 16
Top = 3120
Width = 1215
End
Begin VB.Label Label8
Caption = "D&ept"
Height = 255
Left = 120
TabIndex = 14
Top = 2760
Width = 1215
End
Begin VB.Label Label7
Caption = "Compan&y Name"
Height = 255
Left = 120
TabIndex = 12
Top = 2400
Width = 1215
End
Begin VB.Label Label6
Caption = "Salu&tation"
Height = 255
Left = 120
TabIndex = 10
Top = 2040
Width = 1215
End
Begin VB.Label Label5
Caption = "P&osition"
Height = 255
Left = 120
TabIndex = 8
Top = 1680
Width = 1215
End
Begin VB.Label Label4
Caption = "&Last Name"
Height = 255
Left = 120
TabIndex = 6
Top = 1320
Width = 1215
End
Begin VB.Label Label3
Caption = "&Initial"
Height = 255
Left = 120
TabIndex = 4
Top = 960
Width = 1215
End
Begin VB.Label Label2
Caption = "&First Name"
Height = 255
Left = 120
TabIndex = 2
Top = 600
Width = 1215
End
Begin VB.Label Label1
Caption = "&Mr/Ms"
Height = 255
Left = 120
TabIndex = 0
Top = 240
Width = 1215
End
End
Attribute VB_Name = "Persform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'==========================================================================
'
' This code and information is provided "as is" without warranty of any
' kind, either expressed or implied, including but not limited to the
' implied warranties of merchantability and/or fitness for a particular
' purpose..
'
' Copyright (c) 1998 Multiactive Software Inc. All Rights Reserved.
'
'==========================================================================
Private Sub Command1_Click() 'Add
Load Choice 'Load the Choice form
Choice.Show (1) 'show Choice form with modal mode
If Not ClientInsertType = 0 Then 'If the user not clicking Cancel in the choice form
Persform.Hide 'Hide the Persform in memory but not display
Load Insform 'Load the Insform for inserting a new entry
Insform.Show 'Show the Insform form
Set ClientForm = Persform
Call ClearFields 'Clear all the fields
Set ClientForm = Nothing
If rectype = 1 Then 'If the entry is company
Set ClientForm = Persform
Call Companyfill(1) 'fill in the fields
Set ClientForm = Nothing
Else
Set ClientForm = Persform
Call Personfill(1) 'fill in the fields
Set ClientForm = Nothing
End If
End If
End Sub
Private Sub Command2_Click() 'Close
dbsrecClient.Close
Unload Me 'User chose Cancel, so Unload the form without doing anything
End Sub
Private Sub Command3_Click() 'Update
If rectype = 1 Then Call UpdateCompany 'If company
If rectype = 2 Then Call UpdateIndividual 'If individual
If rectype = 31 Or rectype = 32 Then Call UpdateContact 'If contact
End Sub
Private Sub Command4_Click() 'Delete
Call DeleteClient 'Call the function to delete the current entry
Set ClientForm = Persform
Call ClearFields
Set ClientForm = Nothing
dbsrecClient.MoveFirst 'Move back to the first entry
If Not dbsrecClient.Fields(0) = "" Then 'reassign the data
ci = dbsrecClient.Fields(0)
cn = dbsrecClient.Fields(1)
rectype = dbsrecClient.Fields(2)
ai = dbsrecClient.Fields(3)
If rectype = 1 Then 'If Company
Set ClientForm = Persform
Call Companyfill(1) 'Fill in the fields
Set ClientForm = Nothing
Else
Set ClientForm = Persform
Call Personfill(1) 'Fill in the fields
Set ClientForm = Nothing
End If
End If
End Sub
Private Sub Command5_Click() 'Next
Set ClientForm = Persform
Call ClearFields
Set ClientForm = Nothing
dbsrecClient.MoveNext 'Move to the next record
If dbsrecClient.EOF Then 'If end
MsgBox ("End of the file! Now go back to the first client.")
dbsrecClient.MoveFirst 'Back to the first record
End If
If Not dbsrecClient.Fields(0) = "" Then 'reassign the data
ci = dbsrecClient.Fields(0)
cn = dbsrecClient.Fields(1)
rectype = dbsrecClient.Fields(2)
ai = dbsrecClient.Fields(3)
If rectype = 1 Then 'If company
Set ClientForm = Persform
Call Companyfill(1) 'Fill in the fields
Set ClientForm = Nothing
Else
Set ClientForm = Persform
Call Personfill(1) 'Fill in the fields
End If
End If
End Sub
Private Sub Command6_Click() 'Previous
Set ClientForm = Persform
Call ClearFields
Set ClientForm = Nothing
dbsrecClient.MovePrevious 'Move to the Previous record
If dbsrecClient.BOF Then 'If beginning
MsgBox ("Beginning of the file! Now go to the last client.")
dbsrecClient.MoveLast
End If
If Not dbsrecClient.Fields(0) = "" Then 'reassign the data
ci = dbsrecClient.Fields(0)
cn = dbsrecClient.Fields(1)
rectype = dbsrecClient.Fields(2)
ai = dbsrecClient.Fields(3)
If rectype = 1 Then 'If company
Set ClientForm = Persform
Call Companyfill(1) 'Fill in the fields
Set ClientForm = Nothing
Else
Set ClientForm = Persform
Call Personfill(1) 'Fill in the fields
Set ClientForm = Nothing
End If
End If
End Sub
Private Sub Form_Load()
'To get all entry unique data
Set dbsrecClient = dbs.OpenRecordset("SELECT Client_Id, Contact_Number, Record_Type, Address_Id FROM Client")
dbsrecClient.MoveFirst 'Move to the first record when loading
ci = dbsrecClient.Fields(0)
cn = dbsrecClient.Fields(1)
rectype = dbsrecClient.Fields(2)
ai = dbsrecClient.Fields(3)
If rectype = 1 Then 'If company
Set ClientForm = Persform
Call Companyfill(1) 'Fill in the fields
Set ClientForm = Nothing
Else
Set ClientForm = Persform
Call Personfill(1) 'Fill in the fields
Set ClientForm = Nothing
End If
Unload frmODBCLogon 'Terminate the Login form
Persform.Show 'Show this form
End Sub
Private Sub Mr_GotFocus()
Call SelText(Persform.Mr, 40) 'Call function to Highlight text in this field.
End Sub
Private Sub FirstName_GotFocus()
Call SelText(Persform.FirstName, 40) 'Call function to Highlight text in this field.
End Sub
Private Sub Initial_GotFocus()
Call SelText(Persform.Initial, 2) 'Call function to Highlight text in this field.
End Sub
Private Sub LastName_GotFocus()
Call SelText(Persform.LastName, 60) 'Call function to Highlight text in this field.
End Sub
Private Sub Position_GotFocus()
Call SelText(Persform.Position, 60) 'Call function to Highlight text in this field.
End Sub
Private Sub Salutation_GotFocus()
Call SelText(Persform.Salutation, 40) 'Call function to Highlight text in this field.
End Sub
Private Sub Company_GotFocus()
Call SelText(Persform.Company, 60) 'Call function to Highlight text in this field.
End Sub
Private Sub Dept_GotFocus()
Call SelText(Persform.Dept, 40) 'Call function to Highlight text in this field.
End Sub
Private Sub Division_GotFocus()
Call SelText(Persform.Division, 40) 'Call function to Highlight text in this field.
End Sub
Private Sub Address1_GotFocus()
Call SelText(Persform.Address1, 40) 'Call function to Highlight text in this field.
End Sub
Private Sub Address2_GotFocus()
Call SelText(Persform.Address2, 40) 'Call function to Highlight text in this field.
End Sub
Private Sub City_GotFocus()
Call SelText(Persform.City, 40) 'Call function to Highlight text in this field.
End Sub
Private Sub State_GotFocus()
Call SelText(Persform.State, 40) 'Call function to Highlight text in this field.
End Sub
Private Sub Zip_GotFocus()
Call SelText(Persform.Zip, 20) 'Call function to Highlight text in this field.
End Sub
Private Sub Country_GotFocus()
Call SelText(Persform.Country, 40) 'Call function to Highlight text in this field.
End Sub
Private Sub Phone1_GotFocus()
Call SelText(Persform.Phone1, 22) 'Call function to Highlight text in this field.
End Sub
Private Sub Phone2_GotFocus()
Call SelText(Persform.Phone2, 22) 'Call function to Highlight text in this field.
End Sub
Private Sub Phone3_GotFocus()
Call SelText(Persform.Phone3, 22) 'Call function to Highlight text in this field.
End Sub
Private Sub Phone4_GotFocus()
Call SelText(Persform.Phone4, 22) 'Call function to Highlight text in this field.
End Sub
Private Sub Phone1Ext_GotFocus()
Call SelText(Persform.Phone1Ext, 6) 'Call function to Highlight text in this field.
End Sub
Private Sub Phone2Ext_GotFocus()
Call SelText(Persform.Phone2Ext, 6) 'Call function to Highlight text in this field.
End Sub
Private Sub Phone3Ext_GotFocus()
Call SelText(Persform.Phone3Ext, 6) 'Call function to Highlight text in this field.
End Sub
Private Sub Phone4Ext_GotFocus()
Call SelText(Persform.Phone4Ext, 6) 'Call function to Highlight text in this field.
End Sub