473,748 Members | 8,376 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 1635
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
31838
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
5348
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
9412
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
6821
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
8830
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
9541
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...
1
9321
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
9247
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
8242
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...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
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
4602
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...
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.