473,804 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple Fomatting question. Date to String and back.

I have a simple Formview and in the InsertMode I have a calendar and a
textbox. All I want is for people to click on a date and the date is
populated to the textbox. Here is my simple code and my problem is
converting the DateTxtBox to a date format. Can someone show me how to do
this simple conversion?

Thanks!
Protected Sub Calendar2_Selec tionChanged(ByV al sender As Object, ByVal e As
System.EventArg s)

Dim CalDate As Calendar

CalDate = FormView1.FindC ontrol("Calenda r2")

Dim test As Date

test = CalDate.Selecte dDate

Dim DateTxtBox As TextBox

DateTxtBox = FormView1.FindC ontrol("DateTex tBox")

DateTxtBox = test
End Sub
Oct 24 '06 #1
1 1135
Never mind, I figured it out.

Protected Sub Calendar2_Selec tionChanged(ByV al sender As Object, ByVal e As
System.EventArg s)

Dim CalDate As Calendar

CalDate = FormView1.FindC ontrol("Calenda r2")

Dim test As Date

test = CalDate.Selecte dDate.ToString

Dim DateTxtBox As TextBox

DateTxtBox = FormView1.FindC ontrol("DateTex tBox")

DateTxtBox.Text = test
End Sub



"Phillip Vong" <phillip_vong*a t*yahoo*dot*com wrote in message
news:u7******** ******@TK2MSFTN GP02.phx.gbl...
>I have a simple Formview and in the InsertMode I have a calendar and a
textbox. All I want is for people to click on a date and the date is
populated to the textbox. Here is my simple code and my problem is
converting the DateTxtBox to a date format. Can someone show me how to do
this simple conversion?

Thanks!
Protected Sub Calendar2_Selec tionChanged(ByV al sender As Object, ByVal e
As System.EventArg s)

Dim CalDate As Calendar

CalDate = FormView1.FindC ontrol("Calenda r2")

Dim test As Date

test = CalDate.Selecte dDate

Dim DateTxtBox As TextBox

DateTxtBox = FormView1.FindC ontrol("DateTex tBox")

DateTxtBox = test
End Sub


Oct 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1730
by: gsv2com | last post by:
Maybe I'm tired, but I'm having a small problem with a date function I'm writing. Total noobish I know, but this is just going beyond me for some reason... What I want to happen is send a date (such as June 31, an invalid date) and have the function turn it into a real date by subtraction. In other words, the function would turn the date to June 30, run itself again, and if June 30 is a real date, it'd return it back to the program. ...
38
5096
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find out what i'm doing wrong, and so far it seems i'm doing it the right way. Here's my code...any suggestions would be appreciated. <script language="javascript"> <!-- window.open("256fx/index.htm", "", "height=400, width=600"); //-->
2
1583
by: mirza i | last post by:
thanks for the previous replies. here is the new question (i'm absolutely sure that this should be VERY easy for a good js coder) ok: from asp i call: <img src="pics/cal.gif" onclick="show_calendar_det('document.invdetdet.dx1',
2
1473
by: repairman2003 | last post by:
I'm trying to keep track of two objects, a vector of strings and a user defined date, ints set up in a struct. Having some trouble with it keeping track of the information though. //Defined as private data memebers of a class vector<string> serviceRecord; map<Date,vector<string> > serviceMap; //In a constructor of a class serviceMap.insert(make_pair(date1,serviceRecord));
3
432
by: KevinD | last post by:
thank you for your helpful explanations. In my first note I forgot to mention that my simple flatfile is a text file with a newline character at the end thus I able to get an entire record . Dave V. - I understand your description but as described above, I get all 5 data fields in one file read using fgets.
2
8407
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the client side javacript code for form validation and client side editing capabilities in order to save...
1
1551
by: Brian Henry | last post by:
Hello, I was tring to learn socket's (being i never used them before) and have a simple question. I want to create a listner that will get any data recieved and print it out. I've been able to get it to recieve only one line of data, but the next one i send to it wont be printed like the 1st one. I had a listner running in a thread, does anyone have a simple listner code example that would show how to have a tcplistner thread running...
5
3185
by: troy_lee | last post by:
I have a table that has a PK field with the following format: Dyymm123. So that, a typical number might look like this D0806270. The first character is literal and never changes. The next four digits are derived by the year and month. The final three digits are the sequential numbers given to units throughout the year. In the above example, 270 would simply be the 270th issuance for this entire year. The last three digits reset to 001 on...
25
4551
by: Brian | last post by:
I have a datetimepicker formated for just time, the user selects the time. I want to compare if that time is between midnight and 8 am dtmTime #11:59:59 PM# and dtmTime < #08:00:00 AM# this evaluates to true when the time is not greater than dtmTime #9:32:34 PM# Why is that? and How can I get this to work? Brian
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10350
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10351
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10096
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6866
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.