473,385 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Wrong ADO Date Textbox Format

An incorrect date and time format appears in the Textbox when I _Leave(..)
the date TB and focus on another TB for the same Datagrid index (1/8/05
12:00:00 AM vice 1/8/05).

I have an MS-Access DS bound to a DG and TB’s. The TB’s reveal the contents
of each column of the DG at the specified DG index (one of which is date).

_LoadWinForm(..) {
formatDateTextbox(); //works ok
}

_LeaveDateTextbox(..) {
DSsave();
formatDateTextbox(); //doesn’t work
}

_ValidatingDateTextbox (..) and
_OnListChanged(..)
formatDateTextbox(); //doesn’t work
}

//fires when DG index changes
_CurrentCellChanged(..) {
formatDateTextbox(); // works ok
}

formatDateTextbox() {
DateTime dt = Convert.ToDateTime(DS.Tables[0].Rows[row][col]);
dateTB.Text = dt.ToString("MM/dd/yyyy");
}

Nov 16 '05 #1
1 2205
If I try adding a textbox_BindingContextChange(..) event I get an System Out
of Memory exception, "Error Creating Window Handle"

"Steve B." wrote:
An incorrect date and time format appears in the Textbox when I _Leave(..)
the date TB and focus on another TB for the same Datagrid index (1/8/05
12:00:00 AM vice 1/8/05).

I have an MS-Access DS bound to a DG and TB’s. The TB’s reveal the contents
of each column of the DG at the specified DG index (one of which is date).

_LoadWinForm(..) {
formatDateTextbox(); //works ok
}

_LeaveDateTextbox(..) {
DSsave();
formatDateTextbox(); //doesn’t work
}

_ValidatingDateTextbox (..) and
_OnListChanged(..)
formatDateTextbox(); //doesn’t work
}

//fires when DG index changes
_CurrentCellChanged(..) {
formatDateTextbox(); // works ok
}

formatDateTextbox() {
DateTime dt = Convert.ToDateTime(DS.Tables[0].Rows[row][col]);
dateTB.Text = dt.ToString("MM/dd/yyyy");
}

Nov 16 '05 #2

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

Similar topics

4
by: Gord | last post by:
Hello, VB6 accepts Date and Time values as 'Date'. I'm trying to verify entry into a database I'm creating by verifying that an appropriate Date or Time value has been entered. Using built-in...
4
by: Steve B. | last post by:
How do I format a DataSet (DS), generated from Access, which loads a Textbox (TB) to only show the date in the TB instead of the date and the time? Details: My TB is filled by a DS containing...
7
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...
0
by: GFro | last post by:
I have a calendar page that returns a date to a textbox on the parent page. It is returning the wrong format on the deployment server. On the development server the calendar returns to textbox in...
4
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...
1
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. ...
20
by: andreas | last post by:
When I copy a vb.net project using date formats from one PC with a windows date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I get errors. How can I change for a while in the...
7
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...
2
by: Drum2001 | last post by:
Hello, I am having isues with the following: I have two forms, a MAIN FORM with a SUB FORM: Within the MAIN FORM, I have an unbound textbox (Date Format) and a command button. Onload, the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.