Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Date on Calendar into ADO textbox


Reply
 
Thread Tools Display Modes
  #1  
Old 06-23-2006, 01:07 PM
twychopen22's Avatar
twychopen22 twychopen22 is offline
Centurion
 
Join Date: Jun 2006
Location: Mcallen, Texas USA
Posts: 164
Question Date on Calendar into ADO textbox


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?
Code:
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.
__________________
Van Burkleo Motors INC.
Summer Intern Database Designer Programmer

Ryan Wychopen
Reply With Quote
  #2  
Old 06-23-2006, 01:14 PM
King_George's Avatar
King_George King_George is offline
Junior Contributor
 
Join Date: Feb 2005
Location: Oakville, Ontario Canada
Posts: 353
Default

Quote:
Originally Posted by twychopen22
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?
Code:
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.
__________________
Energy can neither be created or destroyed. It can only be wasted.

Red Green
Reply With Quote
  #3  
Old 06-23-2006, 01:22 PM
twychopen22's Avatar
twychopen22 twychopen22 is offline
Centurion
 
Join Date: Jun 2006
Location: Mcallen, Texas USA
Posts: 164
Default

The first indented line throws error
__________________
Van Burkleo Motors INC.
Summer Intern Database Designer Programmer

Ryan Wychopen
Reply With Quote
  #4  
Old 06-23-2006, 03:06 PM
Shurik12 Shurik12 is offline
Steppe Walker

Retired Moderator
* Expert *
 
Join Date: Jul 2002
Location: Ukraine/Russia/Belgium
Posts: 7,227
Default

If you could explain what "txt box that is joined with an ADO recordset" exactly means in your case

Shurik.
__________________
"A diaper is not like a computer that makes satisfying burbling noises from time to time, hinting at great inner complexity." Malcolm Gladwell

"I'm sitting here completely surrounded by no beer." Onslow, 'Keeping up appearances'
Reply With Quote
  #5  
Old 06-23-2006, 03:28 PM
twychopen22's Avatar
twychopen22 twychopen22 is offline
Centurion
 
Join Date: Jun 2006
Location: Mcallen, Texas USA
Posts: 164
Default

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?
__________________
Van Burkleo Motors INC.
Summer Intern Database Designer Programmer

Ryan Wychopen
Reply With Quote
  #6  
Old 06-23-2006, 03:38 PM
Shurik12 Shurik12 is offline
Steppe Walker

Retired Moderator
* Expert *
 
Join Date: Jul 2002
Location: Ukraine/Russia/Belgium
Posts: 7,227
Default

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.
__________________
"A diaper is not like a computer that makes satisfying burbling noises from time to time, hinting at great inner complexity." Malcolm Gladwell

"I'm sitting here completely surrounded by no beer." Onslow, 'Keeping up appearances'
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->