Date on Calendar into ADO textbox

twychopen22
06-23-2006, 02:07 PM
I have a ADO recordset and I am adding a new record right... When I click "add" everything clears and an option to set Calendar1.Visible = True (show calendar) comes up. I click on the show calendar option and the calendar comes up. The problem is that I want to click a date on the calendar and have it appear in the text box. I have already done this in other forms in this project but not on a txt box that is joined with an ADO recordset. Does anybody know how to do this?
Private Sub Calendar1_Click()
txtDate = Calendar1.Value
Calendar1.Visible = False
End Sub
The error says it is a compile error and improper use of property.

King_George
06-23-2006, 02:14 PM
I have a ADO recordset and I am adding a new record right... When I click "add" everything clears and an option to set Calendar1.Visible = True (show calendar) comes up. I click on the show calendar option and the calendar comes up. The problem is that I want to click a date on the calendar and have it appear in the text box. I have already done this in other forms in this project but not on a txt box that is joined with an ADO recordset. Does anybody know how to do this?
Private Sub Calendar1_Click()
txtDate = Calendar1.Value
Calendar1.Visible = False
End Sub
The error says it is a compile error and improper use of property.

Which line throws the error?

Plus uses txtdate.text = cstr(calendar1.value).
The calendar value is not a string, so you might have to cast it.
Don't rely on the default property.

twychopen22
06-23-2006, 02:22 PM
The first indented line throws error

Shurik12
06-23-2006, 04:06 PM
If you could explain what "txt box that is joined with an ADO recordset" exactly means in your case

Shurik.

twychopen22
06-23-2006, 04:28 PM
Sorry about that. I have a form that scrolls through ADO records. It lists all the employees activities or metrics: sales, phone calls, mailings, emails, etc. We keep track of them everyday. I want the person entering the information to be able to click on the calendar day and have that value as the "date". I think the problem is that I have "date" linked to a database in ADO, but I don't know how to change it and still have it relate to the rest of the database. Does this make more sense?

Shurik12
06-23-2006, 04:38 PM
Thanks for the explanation, but I was mainly intended to know what you mean by "linking/joining" itself. How the data from the database gets into that textbox? Please show the relevant code
(As such This code txtDate.Text = Calendar1.Value should perfectly work

A general comment, you do know your interface better then I but I don't see why a user has to click on the calender to pass a date value to the text box- have you considered using Datapicker which is at a first glance might better suit your needs.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum