Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

binding DatetimePicker control

Posted on 2001-06-16
10
525 Views
Last Modified: 2013-11-25
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
Comment
Question by:paolodp
  • 4
  • 3
  • 2
  • +1
10 Comments
 

Author Comment

by:paolodp
ID: 6199383
PS I'm using ado 2.1 with vb6 SP3
0
 
LVL 7

Expert Comment

by:q2eddie
ID: 6199556
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6200198
Do you have problems with other fields?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:paolodp
ID: 6208977
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6208994
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
 

Author Comment

by:paolodp
ID: 6209060
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6220695
Seems that no other workaround are available!!!
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 100 total points
ID: 6263110
Seems that no other workaround are available!!!
0
 
LVL 7

Expert Comment

by:q2eddie
ID: 6263136
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
 

Expert Comment

by:costello
ID: 6400336
Force accepting proposed answer by emoreau.

costello
Community Support Moderator @ Experts-Exchange
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question