473,509 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text box (Unbound) to Date Type

28 New Member
Hi all,

I have a text box in form and it contains date (get value from combo box). Now I want to convert/change this text box to date type.

Is the anyway I can do it?

Thank you so much.
Shimul
Jan 9 '09 #1
2 5170
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Hi Shimul. To convert the text-based date in your textbox to a date type use the CDate function. Example in VBA:

Expand|Select|Wrap|Line Numbers
  1. Dim SomeDate as Date
  2. SomeDate = CDate(Forms![name of your form]![name of the textbox])
Date/Time values are stored internally as decimal values, with the whole number part the number of days from 1 Jan 1900, and the decimal part the time. CDate converts the text date to its equivalent date type (an elapsed days value essentially), applying the current regional settings for interpretation of the month and day parts.

-Stewart
Jan 10 '09 #2
NeoPa
32,557 Recognized Expert Moderator MVP
As Stewart says, there's not a way to make the TextBox control work as a Date control, but if you cast it on use (CDate()) then it should work for you reliably.
Jan 12 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1690
by: Georges Heinesch | last post by:
Hi. I cannot change the value of an unbound control (txtSR and txtSS) within a sub call. I explain ... my sub (SRSS_set) takes the date (type date) as input, and returns 2 values (type time). ...
7
2322
by: Aravind | last post by:
Hi folks. I have 2 forms, frmBorrow and frmHistory frmBorrow has an unbound multi-column combo box (cboMember) and 7 unbound text boxes (MemNo, MemName, MemIC, MemType, CourseFaculty, Borrow,...
1
2149
by: Serious_Practitioner | last post by:
This is such a simple problem. I've asked for, and gotten, help with this in the past, and I can't make this work. Once more, please - I want to be able to put a member number (which is the...
2
8182
by: hmiller | last post by:
Hope I make my case clear!!! I have a table with two bound date/time fields. I want to be able to use an IF statement and DateDiff to return a text message in an unbound text box. I want to do...
3
2741
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality...
0
1223
by: ncgonz | last post by:
please forgive any ignorance or illogical approaches, i am but a humble beginner. I have written a form (F_Auditorscorecards_Entry) for data entry that writes to a table...
10
3741
by: Gerhard | last post by:
Hi, all I run into the same problem on Access 2000 and 2003. Hopefully someone can replicate it – or not. 1. Create an unbound form – call it Form1. 2. Insert two unbound text boxes –...
5
5317
by: ARC | last post by:
Just found out something interesting with Access 2007... In table design, if you set a memo field to the new rich text option, and put that control on a form, set the control to rich text, you can...
4
2268
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I have created a report. This report needs to display records between two dates entered by the user. I put two text boxes on the report so I can enter the start and end date - I set them to use an...
0
7135
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...
0
7410
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...
1
7067
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...
0
7505
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...
0
5650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1570
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 ...
1
774
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
440
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...

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.