2 Replies - 1110 Views - Last Post: 10 February 2013 - 11:31 AM Rate Topic: -----

#1 ImeehSajol  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 06-February 13

Invalid Property Value with Calendar in VB6.0

Posted 06 February 2013 - 02:09 AM

Hi there, i am experiencing difficulties with my calendar in vb 6.0.

Private Sub Form_Activate()

sSelectedMonth = "January"
sSelectedYear = "2013"
cboMonth.ListIndex = 0
cboYear.ListIndex = 0

End Sub

I used the above code for my calendar but the error says "Invalid Property Value" with that code. Can you help me guys solve this problem? Thank's

Regards,
ImeehSajol

Is This A Good Question/Topic? 0
  • +

Replies To: Invalid Property Value with Calendar in VB6.0

#2 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3227
  • View blog
  • Posts: 10,837
  • Joined: 12-December 12

Re: Invalid Property Value with Calendar in VB6.0

Posted 06 February 2013 - 04:59 AM

Assuming you are talking about a combo-box(?) then it must be populated with items before you can select one of them. This should usually be done on the form's Load (or Initialize?) event.
Was This Post Helpful? 0
  • +
  • -

#3 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Invalid Property Value with Calendar in VB6.0

Posted 10 February 2013 - 11:31 AM

I would personally recommend the Load event over the Initialize event. Referencing controls in the Initialize event isn't considered best practice because doing so automatically fires the Load event. This can create unintended behavior that is hard to trace. This old VB4 page gives a bit more info.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1