address.frm

 VERSION 5.00
Begin VB.Form Form1
   BackColor       =   &H00404080&
   Caption         =   "Address  Diary"
   ClientHeight    =   5715
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5115
   HelpContextID   =   10
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   5715
   ScaleWidth      =   5115
   Begin VB.CommandButton Command6
      Caption         =   "&Close "
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   -1  'True
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1800
      Picture         =   "address.frx":0000
      TabIndex        =   20
      Top             =   5160
      WhatsThisHelpID =   10
      Width           =   1335
   End
   Begin VB.CommandButton Command5
      Caption         =   "&Search"
      Height          =   495
      Left            =   4080
      TabIndex        =   19
      Top             =   120
      WhatsThisHelpID =   10
      Width           =   975
   End
   Begin VB.CommandButton Command4
      Caption         =   "&Last"
      Height          =   495
      Left            =   3600
      TabIndex        =   17
      Top             =   720
      WhatsThisHelpID =   10
      Width           =   975
   End
   Begin VB.CommandButton Command3
      Caption         =   "&Prior"
      Height          =   495
      Left            =   2400
      TabIndex        =   16
      Top             =   720
      WhatsThisHelpID =   10
      Width           =   975
   End
   Begin VB.CommandButton Command2
      Caption         =   "&Next"
      Height          =   495
      Left            =   1320
      TabIndex        =   15
      Top             =   720
      WhatsThisHelpID =   10
      Width           =   975
   End
   Begin VB.CommandButton Command1
      Caption         =   "&First"
      Height          =   495
      Left            =   240
      TabIndex        =   14
      Top             =   720
      WhatsThisHelpID =   10
      Width           =   975
   End
   Begin VB.TextBox Text7
      BackColor       =   &H00404080&
      BorderStyle     =   0  'None
      Height          =   315
      Left            =   1200
      TabIndex        =   12
      Top             =   4800
      WhatsThisHelpID =   10
      Width           =   3255
   End
   Begin VB.TextBox Text6
      BackColor       =   &H00404080&
      BorderStyle     =   0  'None
      Height          =   315
      Left            =   1200
      TabIndex        =   10
      Top             =   4200
      WhatsThisHelpID =   10
      Width           =   3255
   End
   Begin VB.TextBox Text5
      BackColor       =   &H00404080&
      BorderStyle     =   0  'None
      Height          =   315
      Left            =   1200
      TabIndex        =   8
      Top             =   3600
      WhatsThisHelpID =   10
      Width           =   3255
   End
   Begin VB.TextBox Text4
      BackColor       =   &H00404080&
      BorderStyle     =   0  'None
      Height          =   315
      Left            =   1200
      TabIndex        =   6
      Top             =   3000
      WhatsThisHelpID =   10
      Width           =   3255
   End
   Begin VB.TextBox Text3
      BackColor       =   &H00404080&
      BorderStyle     =   0  'None
      Height          =   315
      Left            =   1200
      TabIndex        =   4
      Top             =   2520
      WhatsThisHelpID =   10
      Width           =   3255
   End
   Begin VB.TextBox Text2
      BackColor       =   &H00404080&
      BorderStyle     =   0  'None
      Height          =   315
      Left            =   1200
      TabIndex        =   3
      Top             =   1920
      WhatsThisHelpID =   10
      Width           =   3255
   End
   Begin VB.TextBox Text1
      BackColor       =   &H00404080&
      BorderStyle     =   0  'None
      Height          =   315
      Left            =   1200
      TabIndex        =   1
      Top             =   1440
      WhatsThisHelpID =   10
      Width           =   3255
   End
   Begin VB.Label Label8
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Record(s)   Details"
      BeginProperty Font
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   -1  'True
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   495
      Left            =   960
      TabIndex        =   18
      Top             =   120
      WhatsThisHelpID =   10
      Width           =   3015
   End
   Begin VB.Label Label7
      BackStyle       =   0  'Transparent
      Caption         =   "&Phone 2 :"
      Height          =   255
      Left            =   240
      TabIndex        =   13
      Top             =   4800
      WhatsThisHelpID =   10
      Width           =   855
   End
   Begin VB.Label Label6
      BackStyle       =   0  'Transparent
      Caption         =   "&Phone 1  :"
      Height          =   255
      Left            =   240
      TabIndex        =   11
      Top             =   4200
      WhatsThisHelpID =   10
      Width           =   855
   End
   Begin VB.Label Label5
      BackStyle       =   0  'Transparent
      Caption         =   "&State  :"
      Height          =   255
      Left            =   240
      TabIndex        =   9
      Top             =   3600
      WhatsThisHelpID =   10
      Width           =   855
   End
   Begin VB.Label Label4
      BackStyle       =   0  'Transparent
      Caption         =   "&City :"
      Height          =   255
      Left            =   240
      TabIndex        =   7
      Top             =   3000
      WhatsThisHelpID =   10
      Width           =   855
   End
   Begin VB.Label Label3
      BackStyle       =   0  'Transparent
      Caption         =   "&Address  :"
      Height          =   255
      Left            =   240
      TabIndex        =   5
      Top             =   2520
      WhatsThisHelpID =   10
      Width           =   855
   End
   Begin VB.Label Label2
      BackStyle       =   0  'Transparent
      Caption         =   "&Name  :"
      Height          =   255
      Left            =   240
      TabIndex        =   2
      Top             =   1920
      WhatsThisHelpID =   10
      Width           =   855
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "S/No  :"
      Height          =   255
      Left            =   240
      TabIndex        =   0
      Top             =   1440
      WhatsThisHelpID =   10
      Width           =   855
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''Description: This is small program to handle address records of friends or contacts
''I call this project as My Address Diary
''Author : Sanjay Sharma Contact No:9419118285(M)
''Sainik Colony , Jammu , India
''E-Mail : Sanjay79t@yahoo.co.in , Sanjay79t@hotmail.com
''Bugs , Suggestions & Comments are well come
''This was my App. I own my PC.
''Please vote

Dim rec_val As rec_data
Dim ctr, tot_rec As Long

Dim fnum As Integer

Private Sub Command1_Click()
If tot_rec > 0 Then
ctr = 1
show_rec
Command1.Enabled = False
End If

End Sub

Private Sub Command2_Click()
If tot_rec > 0 Then
ctr = ctr + 1
If ctr <= tot_rec Then
show_rec
Else
MsgBox "No more records present in database"
End If
If ctr > 1 Then
Command1.Enabled = True
End If
End If
End Sub

Private Sub Command3_Click()
If tot_rec > 0 Then
ctr = ctr - 1
If ctr >= 1 Then
show_rec
Else
MsgBox "please wait"
End If
End If
End Sub

Private Sub Command4_Click()
If tot_rec > 0 Then
ctr = tot_rec
show_rec
End If
End Sub

Private Sub Command5_Click()
d_val = "se"
Load Form3
End Sub

Private Sub Command6_Click()
Unload Me
End Sub

Private Sub Form_Load()
'*** Code added by HelpWriter ***
'     SetApphelp Me.hWnd
'***********************************
Form1.Top = -400
Form1.Left = 0
Form1.Width = 5445
Form1.Height = 6780

ctr = 0
fnum = FreeFile
Open App.Path & "\address.san" For Random As #fnum Len = Len(rec_val)
tot_rec = LOF(fnum) / Len(rec_val)

End Sub

Private Sub Form_Unload(Cancel As Integer)
'*** Code added by HelpWriter ***
  '  QuitHelp
'***********************************
Close #fnum
End Sub

Private Sub show_rec()
Get #fnum, ctr, rec_val
Text1.Text = rec_val.s_no
Text2.Text = rec_val.name
Text3.Text = rec_val.addr
Text4.Text = rec_val.city
Text5.Text = rec_val.stat
Text6.Text = rec_val.ph1
Text7.Text = rec_val.ph2
End Sub

Project Homepage: