Solved

binding DatetimePicker control

Posted on 2001-06-16
10
518 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 69

Expert Comment

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

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 69

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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 69

Expert Comment

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

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now