Solved

binding DatetimePicker control

Posted on 2001-06-16
10
529 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
[X]
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
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

752 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