Hi

I have textbox in VB.Net that is bound to a Date/Time field in an
Access database. The date in Access database only has the date and no
time. When you load the dataset into the VB.Net application though,
12:00 time shows up. I realize this is the default but time is
meaningless to our application and makes it look bad.

Can anyone please let me know if there is a way to format a text box
bound to a date field so that is automatically doesn't show the time
part of the date.

I saw a post or two about formatting using substring, but what event
could be used to call this? I know this is a workaround, but is
there a property to just display the date?? There must be an easier
way!!

Any help would be greatly apprecitated!!

Re: How to remove the time portion from a texbox by GVaught

GVaught
Thu Jul 22 15:11:03 CDT 2004

You can try encapsulating the FormatDateTime function around your textbox to
return what you need or convert the textbox to show a string format of the
data, such as String.Format("{0:MM/\dd\/yyyy}", fieldname). The exact syntax
depends on how you are returning the data to the textbox.

--
G Vaught

"vanvee" <vanvee@comcast.net> wrote in message
news:497ae3c2.0407221138.31402c4a@posting.google.com...
> Hi
>
> I have textbox in VB.Net that is bound to a Date/Time field in an
> Access database. The date in Access database only has the date and no
> time. When you load the dataset into the VB.Net application though,
> 12:00 time shows up. I realize this is the default but time is
> meaningless to our application and makes it look bad.
>
> Can anyone please let me know if there is a way to format a text box
> bound to a date field so that is automatically doesn't show the time
> part of the date.
>
> I saw a post or two about formatting using substring, but what event
> could be used to call this? I know this is a workaround, but is
> there a property to just display the date?? There must be an easier
> way!!
>
> Any help would be greatly apprecitated!!



Re: How to remove the time portion from a texbox by Earl

Earl
Thu Jul 22 16:52:17 CDT 2004

YourTextBox.Text = Format(YourDateVariable, "MM/dd/yyyy")


"vanvee" <vanvee@comcast.net> wrote in message
news:497ae3c2.0407221138.31402c4a@posting.google.com...
> Hi
>
> I have textbox in VB.Net that is bound to a Date/Time field in an
> Access database. The date in Access database only has the date and no
> time. When you load the dataset into the VB.Net application though,
> 12:00 time shows up. I realize this is the default but time is
> meaningless to our application and makes it look bad.
>
> Can anyone please let me know if there is a way to format a text box
> bound to a date field so that is automatically doesn't show the time
> part of the date.
>
> I saw a post or two about formatting using substring, but what event
> could be used to call this? I know this is a workaround, but is
> there a property to just display the date?? There must be an easier
> way!!
>
> Any help would be greatly apprecitated!!