473,699 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wierd Date Format Problem In TextBox

1 New Member
Hello There.

I am programming with visual basic within the Excel realm.

I have a problem with the way my selected textbox recognizes dates generated from the datepicker.

I am from New Zealand and have set me PC regional settings accordingly.
Our date format is 26 October 2006, 26/10/06.

I have formatted the textbox with the following code:

textbox60.Value = DTPicker1.Value
textbox60 = Format(textbox6 0, "dddd d mmmm")

This works fine if the days in the month are 13th and above.
Example: Date selected 26/10/06, the text will display as:

Thursday 26 October

But if the days are below the 13th, example:02/10/06, the date will display as:

Friday 10 February

I can see what is happening, the dates are swapping to the U.S format of 10/02/06, this is extremely annoying!!

Can anyone help with some clean up code?

Yours " Visual Virgin'
Oct 18 '06 #1
1 1634
Killer42
8,435 Recognized Expert Expert
Hi, just thought I'd jump in since you haven't got any replies yet.

Could you tell me exactly what data type the DTPicker returns in its Value property? It might be that you are transferring it with some sort of default format, and we all know what that means. Perhaps you need to apply Format() when retrieving this value (and perhaps skip an intermediate step). In other words, instead of
Expand|Select|Wrap|Line Numbers
  1. textbox60.Value = DTPicker1.Value
  2. textbox60 = Format(textbox60, "dddd d mmmm")
maybe you need to say something along these lines
Expand|Select|Wrap|Line Numbers
  1. textbox60.Value = Format(DTPicker1.Value, "dddd d mmmm")
  2.  
Oct 24 '06 #2

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

Similar topics

7
31835
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the current date. If not, I'd like to display the error message to ValidationSummary. It seems to make sense to me to use CompareValidator but the problem is put the current date into CompareValidator. So, I created a hidden text field in my aspx. ...
4
5343
by: Jan Nielsen | last post by:
Hi I have a dataform that shows a date from a MSDE 2000 in a textbox. It uses the format: dd-mm-yyyy hh:mm:ss It would it to use the format dd-mm-yyyy But I can't find a Format property for the textbox. So I tried in the VB code the wizard generates Me.editDateOfBirth.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.objDSBoerneKirken, "tPersoner.DateOfBirth")) Me.editDateOfBirth.Location = New System.Drawing.Point(120, 604)
1
9410
by: Rich | last post by:
Hello, I have some datefields in a dataset (ds1). I bind some textbox controls on a windows form to these date fields in ds1, but I only want to see 01/01/2004 instead of 1/1/2004 8:00:00 AM. In a DateTimePicker control I can set a custom format("MM/dd/yyyy"). So when I iterate through ds1 with currency manager (cma) I see the correct date format in a DateTimePicker control. Is it possible to set a custom date format like that for...
7
6815
by: Richiep | last post by:
I am trying to get a UK format date of dd/mm/yyyy. Why does the following subroutine not return a valid date in a web form? The date returned is #12:00:00 AM# but the date I entered into the text box was 24/06/2006. The other solution I have tried is given by the following two lines that do not compile because a value of date type cannot be converted to datetime:
0
8687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9034
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
8914
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
8883
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
7750
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5874
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
4376
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.