Joyeeta Chanda
Joyeeta Chanda

Reputation: 1

Runtime error 380, invalid property in vb6

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

Answers (2)

C-Pound Guru
C-Pound Guru

Reputation: 16368

If cdDate is a DateTimePicker, you most likely should be using the .Value property rather than .Text.

Upvotes: 1

MarkJ
MarkJ

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

Related Questions