I m using two DTP controls in my VB app linked to Access 2000, one for Begin_Date and one for End_Date field. These two fields are grouped together with other input boxes (text boxes). The two DPTs and input boxes only link to DB when hit Update button, i.e. both DataSource and DataField are linked to an adodc by code when operate, not at design time. The two DPT work well when not linking and did work well when linking before.
However, now one of them doesnt work and always show msg "Unable to bind to field or DataMember: 'end_date' (Error 545)", when the code is linking and it stops at the line:
dtpED.DataField = "end_date". My relevant code as follows:
.....
Set txtSH.DataSource = adoSQL
Set dtpBD.DataSource = adoSQL
Set dtpED.DataSource = adoSQL '!!
Set txtComm.DataSource = adoSQL
.....
txtSH.DataField = "select_history"
dtpBD.DataField = "begin_date"
dtpED.DataField = "end_date" '!!!???
txtComm.DataField = "comments"
.........
txtSH.Refresh
dtpBD.Refresh
dtpED.Refresh
....
txtSH and txtComm are other text boxes, dptBD is another DPT for "Begin_Date", adoSQL has recordset retrieved from the DB by select statement. These is no spelling error or the like, e.g. I copied the Datafield name "end_date" from the select statement for adoSQL and the name is exactly same as its field name in the DB. As said, it worked before and I didnt change anything in this part of code or adoSQL statement, but it now stops working for some reason I really couldnt get idea after tried for two days. Appreciate if whoever knows the tricks related to DateTimePicker bounding to adodc or DB and let me know. By the way, another DTP control Begin_Date is set the same properties as End_Date DTP but receive no error msg.
David



