Reputation: 1
I have developed an application in vb6 which is running properly in Windows XP, but when I try to run it on Windows 7 it is showing runtime error 380, invalid property. Here is the code which causes the error:
Private Sub getData()
txtID.Text = rs!emp_id & ""
txtDept.Text = rs!dept_name & ""
txtDesig.Text = rs!desig_name & ""
txtName.Text = rs!emp_name & ""
txtPFNo.Text = rs!PF_ACC_NO & ""
cdDate.Text = Format(rs!PF_DATE, "dd/mm/yyyy") '(This line produces the error)
txtOwnSubs.Text = rs!SubsO & ""
txtUCont.Text = rs!ContU & ""
txtOptional.Text = rs!Optional & ""
txtLoanSanc.Text = rs!LoanSanc & ""
txtLoanRec.Text = rs!LoanRecovery & ""
txtInt.Text = rs!RateOfInt & ""
txtOSubs.Text = rs!OpeningO & ""
txtOcont.Text = rs!OpeningU & ""
txtCSubs.Text = rs!ClosingO & ""
txtCCont.Text = rs!ClosingU & ""
txtIntDurOwn.Text = rs!InterestO & ""
txtIntDurCont.Text = rs!InterestU & ""
txtIntUptoOwn.Text = rs!CInterestO & ""
txtIntUptoCont.Text = rs!CInterestU & ""
txtTotIntO.Text = rs!CInterestO & ""
txtTotIntC.Text = rs!CInterestU & ""
txtWithdrawn.Text = rs!withdrawn & ""
If rs!Type & "" = "N" Then
cboType.ListIndex = 0
Else
cboType.ListIndex = 1
End If
End Sub
Note: I have created DateCheck.ocx from there I am using cdDate.
Upvotes: 0
Views: 5179
Reputation: 16368
If cdDate
is a DateTimePicker
, you most likely should be using the .Value
property rather than .Text
.
Upvotes: 1
Reputation: 30398
Break the line into multiple steps to find out which part causes the error.
Dim vnt As Variant
vnt = rs!PF_DATE
Dim sDate As String
sDate$ = Format(vnt, "dd/mm/yyyy")
cdDate.Text = sDate
Then investigate further :)
Upvotes: 0