2 Replies - 274 Views - Last Post: 13 August 2013 - 10:07 PM Rate Topic: -----

#1 bobykuriakose12  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 28-May 13

MS Access 2000-data saved but previous data will be deleting

Posted 13 August 2013 - 02:17 PM

Dear sir,

i am programmer i do a project on vb.6.0 and ms access 2000


PROBLEM 1). .if i try to save data on the database its successfully saved but previously saved data will be deleted.

PROBLEM 2). if i add large number of data on database but its not increasing and constantly on 18 numbers.
Is This A Good Question/Topic? 0
  • +

Replies To: MS Access 2000-data saved but previous data will be deleting

#2 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3806
  • View blog
  • Posts: 13,488
  • Joined: 12-December 12

Re: MS Access 2000-data saved but previous data will be deleting

Posted 13 August 2013 - 02:24 PM

You are not providing enough information for someone to help you.

BTW It's 2013 :rolleyes2:
Was This Post Helpful? 0
  • +
  • -

#3 bobykuriakose12  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 28-May 13

Re: MS Access 2000-data saved but previous data will be deleting

Posted 13 August 2013 - 10:07 PM

i also attached source code,i trying to enter new name not existing.if i add 2 record accidently delete 2 previous records............


Dim RS As New ADODB.Recordset
Dim cn As New ADODB.Connection
Dim bData() As Byte

Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset
Dim rs4 As New ADODB.Recordset
Dim rs5 As New ADODB.Recordset
Dim i As Integer
Dim s As String
Dim sql As String
Dim fileSize As Long
Dim fileName As String


Private Sub cmdadd_Click()
txtname.Text = ""
'txtname.Text = ""
txtregno.Text = ""
txtlearnearsno.Text = ""
'txtname.Text = ""
txthousename.Text = ""
txtaddress.Text = ""
txtphoneno.Text = ""
txtplace.Text = ""
txtlclass.Text = ""
dtpictestdate.Value = Date
txtos.Text = ""
chkss.Value = False
txtclamt.Text = ""
chkmcwtgr.Value = False
chkmcwithoutgr.Value = False
chklmv.Value = False
chkmgv.Value = False
chkmpv.Value = False
chkhgv.Value = False
chkhpv.Value = False
chkthreewheel.Value = False
chkautoric.Value = False
txttotalfees.Text = "0"
txtinstamt1.Text = "0"
txtinstamt2.Text = "0"
txtinstamt3.Text = "0"
txtinstamt4.Text = "0"
txtinstamt5.Text = "0"
txtinstamt6.Text = "0"
txtinstamt7.Text = "0"
txtinstamt8.Text = "0"

DTPsam.Value = Date


DTPmy.Value = Date
DTPmy1.Value = Date
DTPmy2.Value = Date
DTPmy3.Value = Date
DTPmy4.Value = Date
DTPmy5.Value = Date
DTPmy6.Value = Date
DTPmy7.Value = Date
DTPmy8.Value = Date
DTPmy9.Value = Date
DTPmy10.Value = Date
DTPmy11.Value = Date
DTPmy12.Value = Date
DTPmy13.Value = Date
DTPmy14.Value = Date
DTPmy15.Value = Date
DTPmy16.Value = Date
DTPmy17.Value = Date
DTPmy18.Value = Date
DTPmy19.Value = Date
DTPmy20.Value = Date
DTPmy21.Value = Date
DTPmy22.Value = Date
DTPmy23.Value = Date
DTPmy24.Value = Date
DTPmy25.Value = Date
DTPmy26.Value = Date
DTPmy27.Value = Date
DTPmy28.Value = Date
DTPmy29.Value = Date
DTPmy30.Value = Date
DTPinstdate1.Value = Date
DTPinstdate2.Value = Date
DTPinstdate3.Value = Date
DTPinstdate4.Value = Date
DTPinstdate5.Value = Date
DTPinstdate6.Value = Date
DTPinstdate7.Value = Date
DTPinstdate8.Value = Date

DTPlearfrom.Value = Date
DTPlearto.Value = Date
txtbalamt.Text = "0"
' cmddelete.Enabled = False
cmdadd.Enabled = True
cmdedit.Enabled = False
cmdsave.Enabled = False
cmdsearch.Enabled = True
txtregno.Enabled = False
txtlearnearsno.Enabled = False
txtname.Enabled = False
txtos.Enabled = False
txtclamt.Enabled = False
chkss.Enabled = False
txthousename.Enabled = False
txtaddress.Enabled = False
txtplace.Enabled = False
txtlclass.Enabled = False
txtphoneno.Enabled = False
dtpictestdate.Enabled = False
chkmcwtgr.Enabled = False
chkmcwithoutgr.Enabled = False
chklmv.Enabled = False
chkmgv.Enabled = False
chkmpv.Enabled = False
chkhgv.Enabled = False
chkhpv.Enabled = False
chkthreewheel.Enabled = False
chkautoric.Enabled = False
txttotalfees.Enabled = False

DTPsam.Enabled = False

DTPmy.Enabled = False
DTPmy1.Enabled = False
DTPmy2.Enabled = False
DTPmy3.Enabled = False
DTPmy4.Enabled = False
DTPmy5.Enabled = False
DTPmy6.Enabled = False
DTPmy7.Enabled = False
DTPmy8.Enabled = False
DTPmy9.Enabled = False
DTPmy10.Enabled = False
DTPmy11.Enabled = False
DTPmy12.Enabled = False
DTPmy13.Enabled = False
DTPmy14.Enabled = False
DTPmy15.Enabled = False
DTPmy16.Enabled = False
DTPmy17.Enabled = False
DTPmy18.Enabled = False
DTPmy19.Enabled = False
DTPmy20.Enabled = False
DTPmy21.Enabled = False
DTPmy22.Enabled = False
DTPmy23.Enabled = False
DTPmy24.Enabled = False
DTPmy25.Enabled = False
DTPmy26.Enabled = False
DTPmy27.Enabled = False
DTPmy28.Enabled = False
DTPmy29.Enabled = False
DTPmy30.Enabled = False
DTPinstdate1.Enabled = False
DTPinstdate2.Enabled = False
DTPinstdate3.Enabled = False
DTPinstdate4.Enabled = False
DTPinstdate5.Enabled = False
DTPinstdate6.Enabled = False
DTPinstdate7.Enabled = False
DTPinstdate8.Enabled = False

txtinstamt1.Enabled = False
DTPinstdate1.Enabled = False
txtinstamt2.Enabled = False
DTPinstdate2.Enabled = False
txtinstamt3.Enabled = False
DTPinstdate3.Enabled = False
txtinstamt4.Enabled = False
DTPinstdate4.Enabled = False
txtinstamt5.Enabled = False
DTPinstdate5.Enabled = False
txtinstamt6.Enabled = False
DTPinstdate6.Enabled = False
txtinstamt7.Enabled = False
DTPinstdate7.Enabled = False
txtinstamt8.Enabled = False
DTPinstdate8.Enabled = False
'txtbalamt.Enabled = False
DTPlearfrom.Enabled = False
DTPlearto.Enabled = False
cmdsave.Enabled = False


' cmddelete.Enabled = False


Image1.Picture = Nothing
txtsrchname.Enabled = True
txtregno.Enabled = True
txtlearnearsno.Enabled = True
txtname.Enabled = True
txthousename.Enabled = True
txtaddress.Enabled = True
txtplace.Enabled = True
txtos.Enabled = True
txtclamt.Enabled = True
chkss.Enabled = True
txtlclass.Enabled = True
txtphoneno.Enabled = True
dtpictestdate.Enabled = True
chkmcwtgr.Enabled = True
chkmcwithoutgr.Enabled = True
chklmv.Enabled = True
chkmgv.Enabled = True
chkmpv.Enabled = True
chkhgv.Enabled = True
chkhpv.Enabled = True
chkthreewheel.Enabled = True
chkautoric.Enabled = True
txttotalfees.Enabled = True

DTPsam.Enabled = True

DTPmy.Enabled = True
DTPmy1.Enabled = True
DTPmy2.Enabled = True
DTPmy3.Enabled = True
DTPmy4.Enabled = True
DTPmy5.Enabled = True
DTPmy6.Enabled = True
DTPmy7.Enabled = True
DTPmy8.Enabled = True
DTPmy9.Enabled = True
DTPmy10.Enabled = True
DTPmy11.Enabled = True
DTPmy12.Enabled = True
DTPmy13.Enabled = True
DTPmy14.Enabled = True
DTPmy15.Enabled = True
DTPmy16.Enabled = True
DTPmy17.Enabled = True
DTPmy18.Enabled = True
DTPmy19.Enabled = True
DTPmy20.Enabled = True
DTPmy21.Enabled = True
DTPmy22.Enabled = True
DTPmy23.Enabled = True
DTPmy24.Enabled = True
DTPmy25.Enabled = True
DTPmy26.Enabled = True
DTPmy27.Enabled = True
DTPmy28.Enabled = True
DTPmy29.Enabled = True
DTPmy30.Enabled = True

DTPinstdate1.Enabled = True
DTPinstdate2.Enabled = True
DTPinstdate3.Enabled = True
DTPinstdate4.Enabled = True
DTPinstdate5.Enabled = True
DTPinstdate6.Enabled = True
DTPinstdate7.Enabled = True
DTPinstdate8.Enabled = True



txtinstamt1.Enabled = True
DTPinstdate1.Enabled = True
txtinstamt2.Enabled = True
DTPinstdate2.Enabled = True
txtinstamt3.Enabled = True
DTPinstdate3.Enabled = True
txtinstamt4.Enabled = True
DTPinstdate4.Enabled = True
txtinstamt5.Enabled = True
DTPinstdate5.Enabled = True
txtinstamt6.Enabled = True
DTPinstdate6.Enabled = True
txtinstamt7.Enabled = True
DTPinstdate7.Enabled = True
txtinstamt8.Enabled = True
DTPinstdate8.Enabled = True
txtbalamt.Enabled = True
DTPlearfrom.Enabled = True
DTPlearto.Enabled = True




' txtname.SetFocus
'txtregno.SetFocus
'txtlearnearsno.SetFocus
cmdsave.Enabled = True
cmdadd.Enabled = False
End Sub

Private Sub cmdedit_Click()
'cmddelete.Enabled = False
cmdadd.Enabled = True
cmdedit.Enabled = False
cmdsave.Enabled = True
cmdsearch.Enabled = True
txtregno.Enabled = True
txtlearnearsno.Enabled = True
txtname.Enabled = True
txthousename.Enabled = True
txtaddress.Enabled = True
txtplace.Enabled = True
txtlclass.Enabled = True
txtphoneno.Enabled = True
txtos.Enabled = True
txtclamt.Enabled = True
chkss.Enabled = True
dtpictestdate.Enabled = True
chkmcwtgr.Enabled = True
chkmcwithoutgr.Enabled = True
chklmv.Enabled = True
chkmgv.Enabled = True
chkmpv.Enabled = True
chkhgv.Enabled = True
chkhpv.Enabled = True
chkthreewheel.Enabled = True
chkautoric.Enabled = True
txttotalfees.Enabled = True
DTPmy.Enabled = True

DTPsam.Enabled = True

DTPmy1.Enabled = True
DTPmy2.Enabled = True
DTPmy3.Enabled = True
DTPmy4.Enabled = True
DTPmy5.Enabled = True
DTPmy6.Enabled = True
DTPmy7.Enabled = True
DTPmy8.Enabled = True
DTPmy9.Enabled = True
DTPmy10.Enabled = True
DTPmy11.Enabled = True
DTPmy12.Enabled = True
DTPmy13.Enabled = True
DTPmy14.Enabled = True
DTPmy15.Enabled = True
DTPmy16.Enabled = True
DTPmy17.Enabled = True
DTPmy18.Enabled = True
DTPmy19.Enabled = True
DTPmy20.Enabled = True
DTPmy21.Enabled = True
DTPmy22.Enabled = True
DTPmy23.Enabled = True
DTPmy24.Enabled = True
DTPmy25.Enabled = True
DTPmy26.Enabled = True
DTPmy27.Enabled = True
DTPmy28.Enabled = True
DTPmy29.Enabled = True
DTPmy30.Enabled = True

DTPinstdate1.Enabled = True
DTPinstdate2.Enabled = True
DTPinstdate3.Enabled = True
DTPinstdate4.Enabled = True
DTPinstdate5.Enabled = True
DTPinstdate6.Enabled = True
DTPinstdate7.Enabled = True
DTPinstdate8.Enabled = True

txtinstamt1.Enabled = True
DTPinstdate1.Enabled = True
txtinstamt2.Enabled = True
DTPinstdate2.Enabled = True
txtinstamt3.Enabled = True
DTPinstdate3.Enabled = True
txtinstamt4.Enabled = True
DTPinstdate4.Enabled = True
txtinstamt5.Enabled = True
DTPinstdate5.Enabled = True
txtinstamt6.Enabled = True
DTPinstdate6.Enabled = True
txtinstamt7.Enabled = True
DTPinstdate7.Enabled = True
txtinstamt8.Enabled = True
DTPinstdate8.Enabled = True
txtbalamt.Enabled = True
DTPlearfrom.Enabled = True
DTPlearto.Enabled = True
End Sub

Private Sub cmdReport_Click()
Dim rsTemp As ADODB.Recordset
If RS.BOF Or RS.EOF Then
MsgBox "No user selected", vbInformation
Exit Sub
End If
Dim code As String
Set rsTemp = cn.Execute("select * from ponnu where Id=" & RS.Fields(0))
Set rptUser.DataSource = rsTemp

If IsNull(rsTemp.Fields("pic").Value) = False Then
ReDim bData(rsTemp.Fields("pic").ActualSize)
bData = rsTemp.Fields("pic").Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1
Set rptUser.Sections("Section1").Controls("Image1").Picture = LoadPicture(szfile)
End If

rptUser.Show

End Sub

Private Sub cmdSave_Click()
If rs4.State Then
rs4.Close
End If

sql = "delete from ponnu where id=" & Int(RS.Fields(0)) & ""
rs4.Open sql, cn, adOpenKeyset, adLockOptimistic

If RS.State Then
RS.Close
End If

sql = "select * from ponnu where id=" & 0 & ""
RS.Open sql, cn, adOpenKeyset, adLockOptimistic
If RS.RecordCount = 0 Then
With RS



RS.AddNew



RS.Fields(1) = bData
RS.Fields(2) = txtregno.Text
RS.Fields(3) = txtlearnearsno.Text
RS.Fields(4) = txtname.Text
RS.Fields(5) = txthousename.Text
RS.Fields(6) = txtaddress.Text
RS.Fields(7) = txtplace.Text
RS.Fields(8) = txtlclass.Text
RS.Fields(9) = txtphoneno.Text
RS.Fields(10) = dtpictestdate.Value
RS.Fields(11) = chkmcwtgr.Value
RS.Fields(12) = chkmcwithoutgr.Value
RS.Fields(13) = txtos.Text
RS.Fields(14) = chkss.Value
RS.Fields(15) = txtclamt.Text

RS.Fields(16) = chklmv.Value
RS.Fields(17) = chkmgv.Value
RS.Fields(18) = chkmpv.Value
RS.Fields(19) = chkhgv.Value
RS.Fields(20) = chkhpv.Value
RS.Fields(21) = chkthreewheel.Value
RS.Fields(22) = chkautoric.Value
RS.Fields(23) = DTPlearfrom.Value
RS.Fields(24) = DTPlearto.Value
If Not Trim(txttotalfees.Text) = "" Then

RS.Fields(25) = txttotalfees.Text
Else
txttotalfees.Text = 0
End If
If Not Trim(txtinstamt1.Text) = "" Then
RS.Fields(26) = txtinstamt1.Text
Else
txtinstamt1.Text = 0
End If
If Not Trim(txtinstamt2.Text) = "" Then
RS.Fields(27) = txtinstamt2.Text
Else
txtinstamt2.Text = 0
End If
If Not Trim(txtinstamt3.Text) = "" Then
RS.Fields(28) = txtinstamt3.Text
Else
txtinstamt3.Text = 0
End If
If Not Trim(txtinstamt4.Text) = "" Then
RS.Fields(29) = txtinstamt4.Text
Else
txtinstamt4.Text = 0
End If
If Not Trim(txtinstamt5.Text) = "" Then
RS.Fields(30) = txtinstamt5.Text
Else
txtinstamt5.Text = 0
End If
If Not Trim(txtinstamt6.Text) = "" Then
RS.Fields(31) = txtinstamt6.Text
Else
txtinstamt6.Text = 0
End If
If Not Trim(txtinstamt7.Text) = "" Then
RS.Fields(32) = txtinstamt7.Text
Else
txtinstamt7.Text = 0
End If
If Not Trim(txtinstamt8.Text) = "" Then
RS.Fields(33) = txtinstamt8.Text
Else
txtinstamt8.Text = 0
End If

RS.Fields(34) = DTPmy.Value
RS.Fields(35) = DTPmy1.Value
RS.Fields(36) = DTPmy2.Value
RS.Fields(37) = DTPmy3.Value
RS.Fields(38) = DTPmy4.Value
RS.Fields(39) = DTPmy5.Value
RS.Fields(40) = DTPmy6.Value
RS.Fields(41) = DTPmy7.Value
RS.Fields(42) = DTPmy8.Value
RS.Fields(43) = DTPmy9.Value
RS.Fields(44) = DTPmy10.Value
RS.Fields(45) = DTPmy11.Value
RS.Fields(46) = DTPmy12.Value
RS.Fields(47) = DTPmy13.Value
RS.Fields(48) = DTPmy14.Value
RS.Fields(49) = DTPmy15.Value
RS.Fields(50) = DTPmy16.Value
RS.Fields(51) = DTPmy17.Value
RS.Fields(52) = DTPmy18.Value
RS.Fields(53) = DTPmy19.Value
RS.Fields(54) = DTPmy20.Value
RS.Fields(55) = DTPmy21.Value
RS.Fields(56) = DTPmy22.Value
RS.Fields(57) = DTPmy23.Value
RS.Fields(58) = DTPmy24.Value
RS.Fields(59) = DTPmy25.Value
RS.Fields(60) = DTPmy26.Value
RS.Fields(61) = DTPmy27.Value
RS.Fields(62) = DTPmy28.Value
RS.Fields(63) = DTPmy29.Value
RS.Fields(64) = DTPmy30.Value
'RS.Fields(74) = DTPsam.Value

RS.Fields(65) = DTPinstdate1.Value
RS.Fields(66) = DTPinstdate2.Value
RS.Fields(67) = DTPinstdate3.Value
RS.Fields(68) = DTPinstdate4.Value
RS.Fields(69) = DTPinstdate5.Value
RS.Fields(70) = DTPinstdate6.Value
RS.Fields(71) = DTPinstdate7.Value
RS.Fields(72) = DTPinstdate8.Value

txtbalamt.Text = Int(txttotalfees.Text) - (RS.Fields(26) + RS.Fields(27) + RS.Fields(28) + RS.Fields(29) + RS.Fields(30) + RS.Fields(31) + RS.Fields(32) + RS.Fields(33))
If Not Trim(txtbalamt.Text) = "" Then
RS.Fields(73) = txtbalamt.Text
Else
txtbalamt.Text = 0

RS.Fields(73) = 0
End If
MsgBox "SUCCESSFULLY SAVED"

RS.Update
End With
End If
'txtname.Text = ""
txtregno.Text = ""
txtlearnearsno.Text = ""
txtname.Text = ""
txthousename.Text = ""
txtaddress.Text = ""
txtphoneno.Text = ""
txtplace.Text = ""
txtlclass.Text = ""
dtpictestdate.Value = Date
txtos.Text = ""
chkss.Value = False
txtclamt.Text = ""
chkmcwtgr.Value = False
chkmcwithoutgr.Value = False
chklmv.Value = False
chkmgv.Value = False
chkmpv.Value = False
chkhgv.Value = False
chkhpv.Value = False
chkthreewheel.Value = False
chkautoric.Value = False
txttotalfees.Text = "0"
txtinstamt1.Text = "0"
txtinstamt2.Text = "0"
txtinstamt3.Text = "0"
txtinstamt4.Text = "0"
txtinstamt5.Text = "0"
txtinstamt6.Text = "0"
txtinstamt7.Text = "0"
txtinstamt8.Text = "0"

DTPsam.Value = Date

DTPmy.Value = Date
DTPmy1.Value = Date
DTPmy2.Value = Date
DTPmy3.Value = Date
DTPmy4.Value = Date
DTPmy5.Value = Date
DTPmy6.Value = Date
DTPmy7.Value = Date
DTPmy8.Value = Date
DTPmy9.Value = Date
DTPmy10.Value = Date
DTPmy11.Value = Date
DTPmy12.Value = Date
DTPmy13.Value = Date
DTPmy14.Value = Date
DTPmy15.Value = Date
DTPmy16.Value = Date
DTPmy17.Value = Date
DTPmy18.Value = Date
DTPmy19.Value = Date
DTPmy20.Value = Date
DTPmy21.Value = Date
DTPmy22.Value = Date
DTPmy23.Value = Date
DTPmy24.Value = Date
DTPmy25.Value = Date
DTPmy26.Value = Date
DTPmy27.Value = Date
DTPmy28.Value = Date
DTPmy29.Value = Date
DTPmy30.Value = Date
DTPinstdate1.Value = Date
DTPinstdate2.Value = Date
DTPinstdate3.Value = Date
DTPinstdate4.Value = Date
DTPinstdate5.Value = Date
DTPinstdate6.Value = Date
DTPinstdate7.Value = Date
DTPinstdate8.Value = Date

DTPlearfrom.Value = Date
DTPlearto.Value = Date
txtbalamt.Text = "0"
' cmddelete.Enabled = False
cmdadd.Enabled = True
cmdedit.Enabled = False
cmdsave.Enabled = False
cmdsearch.Enabled = True
txtregno.Enabled = False
txtlearnearsno.Enabled = False
txtname.Enabled = False
txtos.Enabled = False
txtclamt.Enabled = False
chkss.Enabled = False
txthousename.Enabled = False
txtaddress.Enabled = False
txtplace.Enabled = False
txtlclass.Enabled = False
txtphoneno.Enabled = False
dtpictestdate.Enabled = False
chkmcwtgr.Enabled = False
chkmcwithoutgr.Enabled = False
chklmv.Enabled = False
chkmgv.Enabled = False
chkmpv.Enabled = False
chkhgv.Enabled = False
chkhpv.Enabled = False
chkthreewheel.Enabled = False
chkautoric.Enabled = False
txttotalfees.Enabled = False

DTPsam.Enabled = False


DTPmy.Enabled = False
DTPmy1.Enabled = False
DTPmy2.Enabled = False
DTPmy3.Enabled = False
DTPmy4.Enabled = False
DTPmy5.Enabled = False
DTPmy6.Enabled = False
DTPmy7.Enabled = False
DTPmy8.Enabled = False
DTPmy9.Enabled = False
DTPmy10.Enabled = False
DTPmy11.Enabled = False
DTPmy12.Enabled = False
DTPmy13.Enabled = False
DTPmy14.Enabled = False
DTPmy15.Enabled = False
DTPmy16.Enabled = False
DTPmy17.Enabled = False
DTPmy18.Enabled = False
DTPmy19.Enabled = False
DTPmy20.Enabled = False
DTPmy21.Enabled = False
DTPmy22.Enabled = False
DTPmy23.Enabled = False
DTPmy24.Enabled = False
DTPmy25.Enabled = False
DTPmy26.Enabled = False
DTPmy27.Enabled = False
DTPmy28.Enabled = False
DTPmy29.Enabled = False
DTPmy30.Enabled = False
DTPinstdate1.Enabled = False
DTPinstdate2.Enabled = False
DTPinstdate3.Enabled = False
DTPinstdate4.Enabled = False
DTPinstdate5.Enabled = False
DTPinstdate6.Enabled = False
DTPinstdate7.Enabled = False
DTPinstdate8.Enabled = False

txtinstamt1.Enabled = False
DTPinstdate1.Enabled = False
txtinstamt2.Enabled = False
DTPinstdate2.Enabled = False
txtinstamt3.Enabled = False
DTPinstdate3.Enabled = False
txtinstamt4.Enabled = False
DTPinstdate4.Enabled = False
txtinstamt5.Enabled = False
DTPinstdate5.Enabled = False
txtinstamt6.Enabled = False
DTPinstdate6.Enabled = False
txtinstamt7.Enabled = False
DTPinstdate7.Enabled = False
txtinstamt8.Enabled = False
DTPinstdate8.Enabled = False
'txtbalamt.Enabled = False
DTPlearfrom.Enabled = False
DTPlearto.Enabled = False
cmdsave.Enabled = False
'cmdadd.Enabled = True


End Sub


Private Sub cmdsearch_Click()
MSFlexGrid1.Rows = 1
MSFlexGrid1.Visible = True
If rs5.State Then
rs5.Close
End If

i = 1
MSFlexGrid1.TextMatrix(0, 0) = "ID"
MSFlexGrid1.TextMatrix(0, 1) = "NAME"

If Optname.Value = True Then
sql = "select * from ponnu where name like '" & "%" & Trim(txtsrchname.Text) & "%" & "'"
rs5.Open sql, cn, adOpenKeyset, adLockOptimistic
While Not rs5.EOF
MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
MSFlexGrid1.TextMatrix(i, 0) = rs5.Fields!id
MSFlexGrid1.TextMatrix(i, 1) = rs5.Fields!Name

rs5.MoveNext
i = i + 1

Wend
End If
If Opttestdate.Value = True Then
sql = "select * from ponnu where testdate = #" & DTPsrchtestdate.Value & "# "
rs5.Open sql, cn, adOpenKeyset, adLockOptimistic
While Not rs5.EOF
MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
MSFlexGrid1.TextMatrix(i, 0) = rs5.Fields!id
MSFlexGrid1.TextMatrix(i, 1) = rs5.Fields!Name

rs5.MoveNext
i = i + 1

Wend
End If


If Optlenvaon.Value = True Then
sql = "select * from ponnu where lentodate = #" & DTPlenvalon.Value & "# "
rs5.Open sql, cn, adOpenKeyset, adLockOptimistic
While Not rs5.EOF
MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
MSFlexGrid1.TextMatrix(i, 0) = rs5.Fields!id
MSFlexGrid1.TextMatrix(i, 1) = rs5.Fields!Name

rs5.MoveNext
i = i + 1

Wend
End If

If Optvabt.Value = True Then
sql = "select * from ponnu where lentodate >= #" & DTPlenvalfrom.Value & "# and lentodate <= #" & DTplernvalto.Value & "#"
rs5.Open sql, cn, adOpenKeyset, adLockOptimistic
While Not rs5.EOF
MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
MSFlexGrid1.TextMatrix(i, 0) = rs5.Fields!id
MSFlexGrid1.TextMatrix(i, 1) = rs5.Fields!Name

rs5.MoveNext
i = i + 1

Wend
End If
If optclamt.Value = True Then
sql = "select * from ponnu where tyamount like '" & "%" & Trim(txtsrtyamt.Text) & "%" & "'"
rs5.Open sql, cn, adOpenKeyset, adLockOptimistic
While Not rs5.EOF
MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
MSFlexGrid1.TextMatrix(i, 0) = rs5.Fields!id
MSFlexGrid1.TextMatrix(i, 1) = rs5.Fields!Name

rs5.MoveNext
i = i + 1

Wend
End If
End Sub




Private Sub Command1_Click()
Dim rsTemp As ADODB.Recordset
If RS.BOF Or RS.EOF Then
MsgBox "No user selected", vbInformation
Exit Sub
End If
Dim code As String
Set rsTemp = cn.Execute("select * from ponnu where lentodate >= #" & DTPlenvalfrom.Value & "# and lentodate <= #" & DTplernvalto & "#")
Set leon.DataSource = rsTemp

If IsNull(rsTemp.Fields("pic").Value) = False Then
ReDim bData(rsTemp.Fields("pic").ActualSize)
bData = rsTemp.Fields("pic").Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1
Set leon.Sections("Section1").Controls("Image1").Picture = LoadPicture(szfile)
End If

leon.Show
End Sub

Private Sub Command2_Click()
Dim rsTemp As ADODB.Recordset
If RS.BOF Or RS.EOF Then
MsgBox "No user selected", vbInformation
Exit Sub
End If
Dim code As String
Set rsTemp = cn.Execute("select *FROM ponnu where instdate1 >= #" & incomefrm.Value & "# and instdate1 <= #" & incometo.Value & "# OR instdate2 >= #" & incomefrm.Value & "# and instdate2 <= #" & incometo.Value & "# OR instdate3 >= #" & incomefrm.Value & "# and instdate3 <= #" & incometo.Value & "# OR instdate4 >= #" & incomefrm.Value & "# and instdate4 <= #" & incometo.Value & "# OR instdate5 >= #" & incomefrm.Value & "# and instdate5 <= #" & incometo.Value & "# OR instdate6 >= #" & incomefrm.Value & "# and instdate6 <= #" & incometo.Value & "# OR instdate7 >= #" & incomefrm.Value & "# and instdate7 <= #" & incometo.Value & "# OR instdate8 >= #" & incomefrm.Value & "# and instdate8 <= #" & incometo.Value & "#")
Set income.DataSource = rsTemp

If IsNull(rsTemp.Fields("pic").Value) = False Then
ReDim bData(rsTemp.Fields("pic").ActualSize)
bData = rsTemp.Fields("pic").Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1
Set income.Sections("Section1").Controls("Image1").Picture = LoadPicture(szfile)
End If

income.Show
End Sub

Private Sub Command3_Click()
Dim rsTemp As ADODB.Recordset
If RS.BOF Or RS.EOF Then
MsgBox "No user selected", vbInformation
Exit Sub
End If
Dim code As String
Set rsTemp = cn.Execute("select * from ponnu where Id=" & RS.Fields(0))
Set form5.DataSource = rsTemp

If IsNull(rsTemp.Fields("pic").Value) = False Then
ReDim bData(rsTemp.Fields("pic").ActualSize)
bData = rsTemp.Fields("pic").Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1
Set testdate.Sections("Section1").Controls("Image1").Picture = LoadPicture(szfile)
End If

form5.Show
End Sub

Private Sub Command4_Click()
Dim rsTemp As ADODB.Recordset
If RS.BOF Or RS.EOF Then
MsgBox "No user selected", vbInformation
Exit Sub
End If
Dim code As String
Set rsTemp = cn.Execute("select * from ponnu where Id=" & RS.Fields(0))
Set form141.DataSource = rsTemp

If IsNull(rsTemp.Fields("pic").Value) = False Then
ReDim bData(rsTemp.Fields("pic").ActualSize)
bData = rsTemp.Fields("pic").Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1
Set testdate.Sections("Section1").Controls("Image1").Picture = LoadPicture(szfile)
End If

form141.Show
End Sub

Private Sub Command5_Click()
Dim rsTemp As ADODB.Recordset
If RS.BOF Or RS.EOF Then
MsgBox "No user selected", vbInformation
Exit Sub
End If
Dim code As String
Set rsTemp = cn.Execute("select * from ponnu where Id=" & RS.Fields(0))
Set form15.DataSource = rsTemp

If IsNull(rsTemp.Fields("pic").Value) = False Then
ReDim bData(rsTemp.Fields("pic").ActualSize)
bData = rsTemp.Fields("pic").Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1
Set testdate.Sections("Section1").Controls("Image1").Picture = LoadPicture(szfile)
End If

form15.Show
End Sub

Private Sub Command6_Click()
Dim rsTemp As ADODB.Recordset
If RS.BOF Or RS.EOF Then
MsgBox "No user selected", vbInformation
Exit Sub
End If
Dim code As String
Set rsTemp = cn.Execute("select * from ponnu where Id=" & RS.Fields(0))
Set bal.DataSource = rsTemp

If IsNull(rsTemp.Fields("pic").Value) = False Then
ReDim bData(rsTemp.Fields("pic").ActualSize)
bData = rsTemp.Fields("pic").Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1
Set testdate.Sections("Section1").Controls("Image1").Picture = LoadPicture(szfile)
End If

bal.Show
End Sub

Private Sub Command7_Click()
Dim rsTemp As ADODB.Recordset
If RS.BOF Or RS.EOF Then
MsgBox "No user selected", vbInformation
Exit Sub
End If
Dim code As String
Set rsTemp = cn.Execute("select * from ponnu where balance >0 ")
Set pend.DataSource = rsTemp

If IsNull(rsTemp.Fields("pic").Value) = False Then
ReDim bData(rsTemp.Fields("pic").ActualSize)
bData = rsTemp.Fields("pic").Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1
Set pend.Sections("Section1").Controls("Image1").Picture = LoadPicture(szfile)
End If

pend.Show
End Sub

Private Sub Form_Load()
'Set RS = New ADODB.Recordset
Set cn = New ADODB.Connection
Set RS = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\data.mdb;"
With RS
.ActiveConnection = cn
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Source = "select * from ponnu"
.Open
End With


showRecord
End Sub


Private Sub Image1_DblClick()
CommonDialog1.Filter = "Image Files Only |*.jpg;*.gif;*.bmp"
CommonDialog1.ShowOpen
If CommonDialog1.fileName <> "" Then
Image1.Picture = LoadPicture(CommonDialog1.fileName)
Dim nPos As Long

Open CommonDialog1.fileName For Binary Access Read As #1
ReDim bData(LOF(1))
While (Not EOF(1))
Get #1, (nPos + 1), bData(nPos)
nPos = nPos + 1
Wend

Close #1
Label33.Visible = False
End If
End Sub
Private Sub showRecord()
cmdadd.Enabled = True
If RS.EOF Or RS.BOF Then Exit Sub
ReDim bData(RS.Fields(2).ActualSize)
bData = RS.Fields(1).Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1

' txtregno.Text = rs.Fields(2)



'txtregno.Text = RS.Fields(2)
txtlearnearsno.Text = RS.Fields(3)
txtname.Text = RS.Fields(4)
txthousename.Text = RS.Fields(5)
txtaddress.Text = RS.Fields(6)
txtplace.Text = RS.Fields(7)
txtlclass.Text = RS.Fields(8)
txtphoneno.Text = RS.Fields(9)
dtpictestdate.Value = RS.Fields(10)
chkmcwtgr.Value = RS.Fields(11)
chkmcwithoutgr.Value = RS.Fields(12)
txtos.Text = RS.Fields(13)
chkss.Value = RS.Fields(14)
txtclamt.Text = RS.Fields(15)

chklmv.Value = RS.Fields(16)
chkmgv.Value = RS.Fields(17)
chkmpv.Value = RS.Fields(18)
chkhgv.Value = RS.Fields(19)
chkhpv.Value = RS.Fields(20)
chkthreewheel.Value = RS.Fields(21)
chkautoric.Value = RS.Fields(22)
DTPlearfrom.Value = RS.Fields(23)
DTPlearto.Value = RS.Fields(24)

txttotalfees.Text = RS.Fields(25)
txtinstamt1.Text = RS.Fields(26)
txtinstamt2.Text = RS.Fields(27)

txtinstamt3.Text = RS.Fields(28)

txtinstamt4.Text = RS.Fields(29)

txtinstamt5.Text = RS.Fields(30)

txtinstamt6.Text = RS.Fields(31)

txtinstamt7.Text = RS.Fields(32)

txtinstamt8.Text = RS.Fields(33)

'DTPsam.Value = RS.Fields(74)


DTPmy.Value = RS.Fields(34)
DTPmy1.Value = RS.Fields(35)
DTPmy2.Value = RS.Fields(36)
DTPmy3.Value = RS.Fields(37)
DTPmy4.Value = RS.Fields(38)
DTPmy5.Value = RS.Fields(39)
DTPmy6.Value = RS.Fields(40)
DTPmy7.Value = RS.Fields(41)
DTPmy8.Value = RS.Fields(42)
DTPmy9.Value = RS.Fields(43)
DTPmy10.Value = RS.Fields(44)
DTPmy11.Value = RS.Fields(45)
DTPmy12.Value = RS.Fields(46)
DTPmy13.Value = RS.Fields(47)
DTPmy14.Value = RS.Fields(48)
DTPmy15.Value = RS.Fields(49)
DTPmy16.Value = RS.Fields(50)
DTPmy17.Value = RS.Fields(51)
DTPmy18.Value = RS.Fields(52)
DTPmy19.Value = RS.Fields(53)
DTPmy20.Value = RS.Fields(54)
DTPmy21.Value = RS.Fields(55)
DTPmy22.Value = RS.Fields(56)
DTPmy23.Value = RS.Fields(57)
DTPmy24.Value = RS.Fields(58)
DTPmy25.Value = RS.Fields(59)
DTPmy26.Value = RS.Fields(60)
DTPmy27.Value = RS.Fields(61)
DTPmy28.Value = RS.Fields(62)
DTPmy29.Value = RS.Fields(63)
DTPmy30.Value = RS.Fields(64)

DTPinstdate1.Value = RS.Fields(65)
DTPinstdate2.Value = RS.Fields(66)
DTPinstdate3.Value = RS.Fields(67)
DTPinstdate4.Value = RS.Fields(68)
DTPinstdate5.Value = RS.Fields(69)
DTPinstdate6.Value = RS.Fields(70)
DTPinstdate7.Value = RS.Fields(71)
DTPinstdate8.Value = RS.Fields(72)
' txtbalamt.Text = rs.Fields(73)
txtbalamt.Text = txttotalfees.Text - (RS.Fields(26) + RS.Fields(27) + RS.Fields(28) + RS.Fields(29) + RS.Fields(30) + RS.Fields(31) + RS.Fields(32) + RS.Fields(33))


txtinstamt1.Text = RS.Fields(26)
If Not Trim(txtinstamt1.Text = 0) Then
DTPinstdate1.Value = RS.Fields(65)
End If


txtinstamt2.Text = RS.Fields(27)
If Not Trim(txtinstamt2.Text = 0) Then
DTPinstdate2.Value = RS.Fields(66)
End If

txtinstamt3.Text = RS.Fields(28)
If Not Trim(txtinstamt3.Text = 0) Then
DTPinstdate3.Value = RS.Fields(67)
End If

txtinstamt4.Text = RS.Fields(29)
If Not Trim(txtinstamt4.Text = 0) Then
DTPinstdate4.Value = RS.Fields(68)
End If

txtinstamt5.Text = RS.Fields(30)
If Not Trim(txtinstamt5.Text = 0) Then
DTPinstdate5.Value = RS.Fields(69)
End If

txtinstamt6.Text = RS.Fields(31)
If Not Trim(txtinstamt6.Text = 0) Then
DTPinstdate6.Value = RS.Fields(70)
End If

txtinstamt7.Text = RS.Fields(32)
If Not Trim(txtinstamt7.Text = 0) Then
DTPinstdate7.Value = RS.Fields(71)
End If

txtinstamt8.Text = RS.Fields(33)
If Not Trim(txtinstamt8.Text = 0) Then
DTPinstdate8.Value = RS.Fields(72)
End If





Image1.Picture = LoadPicture(szfile)

End Sub

Private Sub Label32_Click()
Dim theWebSite As String
theWebSite = "http://www.keralamvd.gov.in/"
Call Shell("explorer.exe " & theWebSite, vbNormalFocus)
End Sub

Private Sub MSFlexGrid1_Click()
cmdedit.Enabled = True
'cmddelete.Enabled = True
cmdadd.Enabled = True
cmdsave.Enabled = False
cmdsearch.Enabled = True
MSFlexGrid1.Visible = False
Frame3.Visible = False
Label33.Visible = False
If RS.State Then
RS.Close
End If

sql = "select * from ponnu where id=" & Trim(MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 0)) & ""
RS.Open sql, cn, adOpenKeyset, adLockOptimistic
If RS.RecordCount > 0 Then
With RS
End With
End If
showRecord
End Sub


Private Sub optclamt_Click()

If optclamt.Value = True Then
txtsrtyamt.Enabled = True
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False


ElseIf Optname.Value = True Then
txtsrchname.Enabled = True
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Opttestdate.Value = True Then
txtsrchname.Enabled = False
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = True
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Optlenvaon.Value = True Then
txtsrchname.Enabled = False
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = False
txtsrtyamt.Enabled = False
DTPlenvalon.Enabled = True
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Optvabt.Value = True Then
txtsrchname.Enabled = False
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = True
DTplernvalto.Enabled = True
End If
End Sub


Private Sub Optlenvaon_Click()
If Optname.Value = True Then
txtsrchname.Enabled = True
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf optclamt.Value = True Then
txtsrtyamt.Enabled = True
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Opttestdate.Value = True Then
txtsrchname.Enabled = False
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = True
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Optlenvaon.Value = True Then
txtsrchname.Enabled = False
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = False
txtsrtyamt.Enabled = False
DTPlenvalon.Enabled = True
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Optvabt.Value = True Then
txtsrchname.Enabled = False
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = True
DTplernvalto.Enabled = True
End If
End Sub

Private Sub Optname_Click()
If Optname.Value = True Then
txtsrchname.Enabled = True
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Opttestdate.Value = True Then
txtsrchname.Enabled = False
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = True
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Optlenvaon.Value = True Then
txtsrtyamt.Enabled = False
txtsrchname.Enabled = False
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = True
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Optvabt.Value = True Then
txtsrchname.Enabled = False
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = True
DTplernvalto.Enabled = True
End If

'ElseIf optclamt.Value = True Then
txtsrtyamt.Enabled = True
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False
End Sub

Private Sub Opttestdate_Click()
If Optname.Value = True Then
txtsrchname.Enabled = True
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False
txtsrtyamt.Enabled = False

ElseIf Opttestdate.Value = True Then
txtsrchname.Enabled = False
DTPsrchtestdate.Enabled = True
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False
txtsrtyamt.Enabled = False

ElseIf Optlenvaon.Value = True Then
txtsrchname.Enabled = False
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = True
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False
txtsrtyamt.Enabled = False

ElseIf Optvabt.Value = True Then
txtsrchname.Enabled = False
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = True
DTplernvalto.Enabled = True

ElseIf optclamt.Value = True Then
txtsrtyamt.Enabled = True
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False


End If

End Sub

Private Sub Optvabt_Click()
If Optname.Value = True Then
txtsrchname.Enabled = True
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Opttestdate.Value = True Then
txtsrchname.Enabled = False
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = True
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Optlenvaon.Value = True Then
txtsrchname.Enabled = False
txtsrtyamt.Enabled = False
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = True
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False

ElseIf Optvabt.Value = True Then
txtsrchname.Enabled = False
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = True
DTplernvalto.Enabled = True
txtsrtyamt.Enabled = False

ElseIf optclamt.Value = True Then
txtsrtyamt.Enabled = True
DTPsrchtestdate.Enabled = False
DTPlenvalon.Enabled = False
DTPlenvalfrom.Enabled = False
DTplernvalto.Enabled = False


End If
End Sub


Private Sub PrintForm_Click()
PrintForm
End Sub

Private Sub rpt1_Click()
Dim rsTemp As ADODB.Recordset
If RS.BOF Or RS.EOF Then
MsgBox "No user selected", vbInformation
Exit Sub
End If
Dim code As String
Set rsTemp = cn.Execute("select * from ponnu where testdate = #" & DTPsrchtestdate.Value & "# ")
Set testdate.DataSource = rsTemp

If IsNull(rsTemp.Fields("pic").Value) = False Then
ReDim bData(rsTemp.Fields("pic").ActualSize)
bData = rsTemp.Fields("pic").Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1
Set testdate.Sections("Section1").Controls("Image1").Picture = LoadPicture(szfile)
End If

testdate.Show
End Sub

Private Sub rpt2_Click()
Dim rsTemp As ADODB.Recordset
If RS.BOF Or RS.EOF Then
MsgBox "No user selected", vbInformation
Exit Sub
End If
Dim code As String
Set rsTemp = cn.Execute("select * from ponnu where mydate >= #" & opjoinfrm.Value & "# and mydate <= #" & opjointo.Value & "#")
Set doj.DataSource = rsTemp

If IsNull(rsTemp.Fields("pic").Value) = False Then
ReDim bData(rsTemp.Fields("pic").ActualSize)
bData = rsTemp.Fields("pic").Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1
Set doj.Sections("Section1").Controls("Image1").Picture = LoadPicture(szfile)
End If

doj.Show
End Sub

Private Sub rpt3_Click()
Dim rsTemp As ADODB.Recordset
If RS.BOF Or RS.EOF Then
MsgBox "No user selected", vbInformation
Exit Sub
End If
Dim code As String
Set rsTemp = cn.Execute("select * from ponnu where lentodate = #" & DTPlenvalon.Value & "# ")
Set leon.DataSource = rsTemp

If IsNull(rsTemp.Fields("pic").Value) = False Then
ReDim bData(rsTemp.Fields("pic").ActualSize)
bData = rsTemp.Fields("pic").Value
szfile = App.Path & "\tempPic.tmp"
Open szfile For Binary Access Write As #1
Put #1, , bData
Close #1
Set leon.Sections("Section1").Controls("Image1").Picture = LoadPicture(szfile)
End If

leon.Show
End Sub
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1