473,323 Members | 1,547 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,323 software developers and data experts.

Time portion displayed when field has the focus

Using Access2K...
I have a field StartDate
The format is set to "Short Date". Sure enough, it diplays
"01/30/2004" etc.
Except, if a user clicks the field, the time portion 12:00:00 AM shows
until the field loses the focus. Is there a way to prevent the time
portion from showing?
Thanks
lq
Nov 12 '05 #1
4 1780
Do you have an Input Mask than may be causing this?

--
Wayne Morgan
Microsoft Access MVP
"Lauren Quantrell" <la*************@hotmail.com> wrote in message
news:47**************************@posting.google.c om...
Using Access2K...
I have a field StartDate
The format is set to "Short Date". Sure enough, it diplays
"01/30/2004" etc.
Except, if a user clicks the field, the time portion 12:00:00 AM shows
until the field loses the focus. Is there a way to prevent the time
portion from showing?
Thanks
lq

Nov 12 '05 #2
It depends on your data. If you set the format property for the table
to "Short Date" and the format property of the Text box to "Short
Date" but then default or enter the data with a time component, the
time component will be displayed when you enter the field.

Use Date() rather than Now() for the default or remove the time
component in the AfterUpdate event of the field. The following code
seems to work by stripping off the time component or fraction part of
the underlying value.

Private Sub TestDate1_AfterUpdate()
'Remove the time component from the value entered
TestDate1.Value = CDate(Int(TestDate1.Value))
End Sub

There are lots of posts in this news group regarding format and "Short
Date". Take some time to browse them - you'll learn heaps. This has
been answered before.
Nov 12 '05 #3
Thanks for the response.
I'm using no input mask. I have a smalldatetime column (SQL Server
backend) and I need to store date AND time in it. I convert it all to
GMT depending on where the user is, an the table cotains tens of
thousands of records.
Sometimes I need to display it only as a date and drop off the time.
That's where I have the problem with Access showing the time anyway
when the field has the focus.
lq

"Wayne Morgan" <co***************************@hotmail.com> wrote in message news:<Zb******************@newssvr16.news.prodigy. com>...
Do you have an Input Mask than may be causing this?

--
Wayne Morgan
Microsoft Access MVP
"Lauren Quantrell" <la*************@hotmail.com> wrote in message
news:47**************************@posting.google.c om...
Using Access2K...
I have a field StartDate
The format is set to "Short Date". Sure enough, it diplays
"01/30/2004" etc.
Except, if a user clicks the field, the time portion 12:00:00 AM shows
until the field loses the focus. Is there a way to prevent the time
portion from showing?
Thanks
lq

Nov 12 '05 #4
"Lauren Quantrell" <la*************@hotmail.com> wrote in message
news:47**************************@posting.google.c om...
Thanks for the response.
I'm using no input mask. I have a smalldatetime column (SQL Server
backend) and I need to store date AND time in it. I convert it all to
GMT depending on where the user is, an the table cotains tens of
thousands of records.
Sometimes I need to display it only as a date and drop off the time.
That's where I have the problem with Access showing the time anyway
when the field has the focus.


If you use the format property this is the normal behavior. Display only uses
the format property until the control has focus at which point you see the
actual stored data. If the user does not need to edit the field you can use the
Format Function instead of the format property. If they do need to edit it then
you would have to use a mask. This would set the time back to midnight whenever
they edited the control though.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #5

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

Similar topics

1
by: Richard The Lost | last post by:
I am trying to create a mask for a time value typically of 02:23.45 and while I can get the mask to show in the box when it loses focus it rounds the number in some way to 02:24. I want to put...
3
by: Jay | last post by:
I previously posted this question under Visual Basic newsgroup, but was advised to re-post here. I'm hoping someone can help me solve an issue I'm having with VB.Net and Access 2000. Here's...
2
by: Lauren Quantrell | last post by:
I have two columns in a table: StartDate DateTime and StartTime DateTime. The StartDate column holds a value such as 07/16/2004 The StartTime column holds a value such as 3:00:00 PM I want to...
6
by: Kenneth | last post by:
Hello, I'm having some serious problems debugging a script that I'm trying to make work. I'm working on a form where a user can type in a time (in the format of HH:MM), and another script...
16
by: PK9 | last post by:
I have a string variable that holds the equivalent of a DateTime value. I pulled this datetime from the database and I want to strip off the time portion before displaying to the user. I am...
5
by: rs | last post by:
I have a table with a timestamp field which contains the date and time. ie. 9/13/2004 9:10:00 AM. I would like to split this field into 2 fields, one with just the DATE portion ie 9/13/2004 and...
6
by: fniles | last post by:
I am using VB.NET 2003 and SQL Server 2000. I have a table with a datetime column type. When inserting into the table for that column, I set it to Date.Now.ToString("T") , which is something like...
2
imrosie
by: imrosie | last post by:
Hi, I need some help please. I have an image database (which so far works great) However, when I pull in a file in the form to store (actually the link), the image is shown in a subform and the...
1
by: George | last post by:
Hello........I have a problem adding up record entries with more than 24 hours when the fields are formatted as hour/minute (h:m). If the actual summed total of all records is greater than 24...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.