0

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.

Antagony
  • 1,750
  • 12
  • 17
  • 1
    Checkout the following question that addresses the same problem: http://stackoverflow.com/questions/1979281/what-causes-this-error-runtime-error-380-invalid-property-value – Cyclonecode Sep 06 '12 at 07:50
  • What type of control is cdDate? And do you have the same regional settings (especially date format) on the Win 7 PC as on the Win XP PC? – MarkJ Sep 06 '12 at 11:48
  • And what line is it failing on? – Deanna Sep 07 '12 at 11:12

2 Answers2

1

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

C-Pound Guru
  • 15,967
  • 6
  • 46
  • 67
0

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 :)

MarkJ
  • 30,070
  • 5
  • 68
  • 111