Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 545
  • Last Modified:

binding DatetimePicker control

I have a form where I try to bind a DTpicker control to a recordset field using datafield and datasource properties.
When user edit the date, an error appears stating:

Databinding collection error - field not updatable

Note that changes are registered in the field.
If I use a textbox with the same datafield and datasource properties, I have no error.
How to avoid the databinding error ?
0
paolodp
Asked:
paolodp
  • 4
  • 3
  • 2
  • +1
1 Solution
 
paolodpAuthor Commented:
PS I'm using ado 2.1 with vb6 SP3
0
 
q2eddieCommented:
Hi, paolodp.

#Questions
1. Are you setting the data properties at run-time (thru code)?
2. Is this the exact wording of the error message?

#Links
1. "HOWTO: Change Databindings on the Fly"
http://support.microsoft.com/support/kb/articles/q189/8/52.asp

2. "BUG: Error Message Received When You Use the DTPicker to Update Table"
http://support.microsoft.com/support/kb/articles/q288/7/72.ASP

Bye. -e2
0
 
Éric MoreauSenior .Net ConsultantCommented:
Do you have problems with other fields?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
paolodpAuthor Commented:
1. Yes, I set datamember and datasource properties at run-time.

2. the exact wording of the error message is:

Binding Collection Error (msgbox title)

Field not updatable, Bound property name:Value, Field name:FirstDate


(FirstDate is a field in the open table)

Error raises on lostfocus event or, if using calendar popup window, when calendar window closes (clicking a date).
 
0
 
Éric MoreauSenior .Net ConsultantCommented:
I sometimes have this problem with combos. To fix it, I use an invisible label which is bound (the combo isn't). In the change event of the label, I set the combo and in the change event of the combo, I set the label. I'm sure that this will work for you.
0
 
paolodpAuthor Commented:
Thank you for your tip, emoreau
I've already used this method; I could use also a textbox with a validation function, but before resignating to do one of these, I'd like to succeed to use the control as it should be used. MSKB does not mention this problem, I suppose not to be the first using a DatetimePicker bound control and I'd like to understand how and why.
0
 
Éric MoreauSenior .Net ConsultantCommented:
Seems that no other workaround are available!!!
0
 
Éric MoreauSenior .Net ConsultantCommented:
Seems that no other workaround are available!!!
0
 
q2eddieCommented:
Hey, paolodp.

#Questions
1. Are you using a datetime-type field for your dtpicker?

#Comments
Recently, I read somewhere that the first datetime-type field in a database is often interpreted as a timestamp field.  Add a second datetime-type field and see what happens.

Bye. -e2
0
 
costelloCommented:
Force accepting proposed answer by emoreau.

costello
Community Support Moderator @ Experts-Exchange
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now