Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Displaying Date in MaskedEdit 1

Status
Not open for further replies.

mamartin

Programmer
Aug 10, 2001
75
US
I know (hope!) that there is an easy solution to this one. Why, when I display a date on my form, is the date wrong? Using VB6.0 with a SQL Server 7.0 DB. I have a table (Damages) and a datetime field (Date_Opened). My form accepts the date in with a format of dd-mmm-yyyy. When the row is written to the table, it goes in like d/m/yy. When the row is displayed on the form after a search function, the date is all hosed up. For example, if I enter my Open Date as 01-JAN-2004, when I do a search, it displays 11-___-____. The Open Date field on the VB form as a MaskEdBox (mskOpenDate). I set the .mask = "##-???-####" and the .Format to "dd-mmm-yyyy". If I run debug when entering data, the date looks correct. It also looks OK in the DB, only when I do the re-display does it look wrong. Any ideas? Thanks in advance,

Michael A. Martin
 
Have you tried formating the date before assigning it to the mask edit box?

Code:
MaskEdBox3.Text = Format(Date, "dd-MMM-yyyy")

The .mask was set to "##-???-####" and the .Format to "dd-mmm-yyyy". All other properties were set to default values.

zemp
 
Hi mamartin

Can you help me? I don't know what do for that in the form it is display this character (/) for example:

The data is 524/012/04 in TextBox but, I capture this character ( / ), there is some code for not to capture this character. REally I want ask you If MASK EDIT may function with this, and how?.

Thanks a lot by your attention.
 
lizz3030,

This appears to be repeat of thread222-787275. Did you read faq222-2244? It should guide you to avoid double posting, which is discouraged in the forum.

If the answer you get in the original thread didn't answer your question then please return to that thread and clarify your question, or say why the given solution didn't work.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Hi all;

In my program i use a DataReport connected to a DataEnvironment. the DE gets the Informations from my (Access Table made with the administration of Visual Basic) ;
In the form I change some data and I do click in button " keep these changes", that ok, but If I do click in button " exit "; also keep the changes, here the problem.

I know what to do?

Thanks a lot.
 
This appears to be another duplicate post. See thread222-793508. lizz3030 did you read faq222-2244 regarding double posting?

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top